本文整理匯總了PHP中Zend_Form_Element_Textarea::addErrorMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Form_Element_Textarea::addErrorMessage方法的具體用法?PHP Zend_Form_Element_Textarea::addErrorMessage怎麽用?PHP Zend_Form_Element_Textarea::addErrorMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Form_Element_Textarea
的用法示例。
在下文中一共展示了Zend_Form_Element_Textarea::addErrorMessage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init($options = null)
{
$this->setName('contact');
$this->setMethod('post');
$this->setAction('/about/contact');
$name = new Zend_Form_Element_Text('name');
$name->setAttrib('size', 35);
$name->setLabel('Your Name:');
$name->setRequired(true);
$name->addErrorMessage('Please provide your name');
$email = new Zend_Form_Element_Text('email');
$email->setAttrib('size', 35);
$email->setLabel('Your E-mail Address:');
$email->setRequired(true);
$email->addErrorMessage('Please provide a valid e-mail address');
$email->addValidator('EmailAddress');
$message = new Zend_Form_Element_Textarea('message');
$message->setLabel('Your Message:');
$message->setRequired(true);
$message->setAttrib('rows', '10');
$message->setAttrib('cols', '55');
$message->addErrorMessage('Please specify a message');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Send Your Message!');
$this->addElements(array($name, $email, $message, $submit));
}