下面的代碼不顯示驗證消息,我應該打印任何可變的任何地方。請指教。zend驗證消息不顯示
$username = new Zend_Form_Element_Text('username', array('autocomplete' => 'off'));
$username->setLabel('Username')
->setDecorators($elementDecoration)
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty', true, array('messages'=>'Cannot be empty'));
$elementDecoration = array(
'ViewHelper',
'Description',
'Errors',
array(array('data' => 'HtmlTag'), array('tag' => 'td')),
array('Label', array('tag' => 'td', 'placement' => 'prepend')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
);
我留下了一些錯誤,因爲setDecorators – Bharanikumar 2013-03-26 11:28:22