Create a gist now

Instantly share code, notes, and snippets.

ZF2 フォームのバリデーションエラーメッセージ表示用ビューヘルパー
<?php
namespace Album\Helper;
use Zend\Form\View\Helper\FormElementErrors as ZendFormElementErrors;
/**
* フォームのバリデーションエラーメッセージ表示用ビューヘルパー
*/
class FormElementErrors extends ZendFormElementErrors
{
protected $messageCloseString = '</li></ul>';
protected $messageOpenFormat = '<ul class="err-msg" %s><li>';
protected $messageSeparatorString = '</li><li>';
}
<?php
//...
public function getViewHelperConfig()
{
return array(
'invokables' => array(
'formElementErrors' => 'Album\Helper\FormElementErrors',
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment