本文整理汇总了PHP中Zend_Form_Element_Textarea::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Textarea::setDescription方法的具体用法?PHP Zend_Form_Element_Textarea::setDescription怎么用?PHP Zend_Form_Element_Textarea::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Textarea
的用法示例。
在下文中一共展示了Zend_Form_Element_Textarea::setDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFormElement
public function renderFormElement()
{
$elm = new Zend_Form_Element_Textarea($this->getName(), array('label' => $this->getLabel() . ':'));
$elm->setDescription($this->getDescription());
$elm->setValue($this->getValue());
$elm->setRequired($this->getRequired());
return $elm;
}
示例2: init
public function init()
{
$this->setMethod("POST");
$this->setName("createAdAgencyForm");
if (!empty($this->next)) {
$element = new Zend_Form_Element_Hidden("next");
$element->setValue($this->next);
$this->addElement($element);
}
$element = new Zend_Form_Element_Hidden(AdvertisingAgency::CITY);
$element->setValue($this->city->id);
$this->addElement($element);
$element = new Zend_Form_Element_Text(User::NAME);
$element->setLabel('怎么称呼您');
$element->setDescription('必填,中英文都可,2到30个字');
$this->addElement($element);
$element = new Zend_Form_Element_Text(User::EMAIL);
$element->setLabel('您的Email');
$element->setDescription('必填,方便我们联系您');
$element->setRequired(true);
$element->addValidator(new Zend_Validate_EmailAddress());
$element->addValidator('NotEmpty');
$this->addElement($element);
$element = new Zend_Form_Element_Text(User::MOBILE);
$element->setLabel('您的手机号');
$element->addFilter(new Zend_Filter_HtmlEntities());
$element->addFilter(new Zend_Filter_StripTags());
$element->setDescription('方便我们及时联系您');
$this->addElement($element);
$this->addDisplayGroup(array('city_id', 'name', 'email', 'mobile'), 'aboutYou');
$this->getDisplayGroup('aboutYou')->removeDecorator('DtDdWrapper');
$element = new Zend_Form_Element_Textarea(AdvertisingAgency::DESCRIPTION);
$element->setAttrib('rows', 6);
$element->setLabel("有哪些人要入住?基本情况?尽量详细!");
$element->setDescription('如:三口之家,男30岁在爱立信有稳定工作,不吸烟;女27岁在kth读计算机硕士,不吸烟,男孩6岁。整洁,爱干净。');
$element->setRequired(true);
$this->addElement($element);
$element = new Zend_Form_Element_Textarea(AdvertisingAgency::COMMENT);
$element->setAttrib('rows', 6);
$element->setLabel("对房子的要求?最高房租?最小面积?地点?入住时间?");
$element->setDescription('如:最好是一室一厅的整个公寓,也可以与其他人合租。可以合用厨房卫生间。最高房租10000kr每月,最小面积30平米。地点只要是地铁附近,不要离中心太远都可以。入住时间是9月1日,希望能长租。');
$element->setRequired(true);
$this->addElement($element);
$element = new Elements();
$element->addReCaptcha($this);
$element = new Zend_Form_Element_Submit("post");
$this->addElement($element);
$this->addDisplayGroup(array(AdvertisingAgency::DESCRIPTION, AdvertisingAgency::COMMENT, 'challenge', 'post'), 'aboutRoom');
$this->getDisplayGroup('aboutRoom')->removeDecorator('DtDdWrapper');
}
示例3: init
public function init()
{
$this->setMethod('POST');
$this->setName('sendEmailForm');
//$this->setAction('index/view');
$element = new Zend_Form_Element_Hidden('id');
$element->setValue($this->advertisement->id);
$this->addElement($element);
$element = new Zend_Form_Element_Hidden('city');
$element->setValue($this->city);
$this->addElement($element);
$element = new Zend_Form_Element_Text('name');
$element->setLabel('怎么称呼您');
$element->setRequired(true);
$element->setDescription('必填');
$this->addElement($element);
$element = new Zend_Form_Element_Text('email');
$element->setLabel('您的Email');
$element->setRequired(true);
$element->addValidator(new Zend_Validate_EmailAddress());
$element->addFilter(new Zend_Filter_HtmlEntities());
$element->addFilter(new Zend_Filter_StripTags());
$element->addValidator('NotEmpty');
$element->setDescription('必填');
$this->addElement($element);
$element = new Zend_Form_Element_Textarea('body');
$element->setLabel('内容');
$element->setRequired(true);
$element->addValidator('NotEmpty');
$element->setDescription('必填');
$element->setAttrib('rows', 4);
$this->addElement($element);
$element = new Elements();
$element->addReCaptcha($this);
$element = new Zend_Form_Element_Submit('send');
$element->setValue('发送');
$element->removeDecorator('Label');
$this->addElement($element);
}
示例4: init
public function init()
{
if (isset($this->advertisement)) {
$user = Advertisement::getUser($this->advertisement->id);
$element = new Zend_Form_Element_Hidden('id');
$element->setValue($this->advertisement->id);
$this->addElement($element);
$element = new Zend_Form_Element_Hidden('password');
$element->setValue($this->password);
$this->addElement($element);
$this->setAction('/' . strtolower($this->city->name) . '/bulletin/update');
} else {
$this->setAction('/' . strtolower($this->city->name) . '/bulletin/create');
}
$element = new Zend_Form_Element_Hidden('city');
$element->setValue($this->city->id);
$this->addElement($element);
$this->setMethod('POST');
$this->setName('createAdForm');
$element = new Zend_Form_Element_Text('name');
$element->setLabel('怎么称呼您');
$element->setDescription('必填,中英文都可,2到30个字');
$element->setRequired(true);
//$element->addValidator(new Zend_Validate_StringLength(2,30));
if (isset($user)) {
$element->setValue($user->name);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('email');
$element->setLabel('您的Email');
$element->setRequired(true);
$element->addValidator(new Zend_Validate_EmailAddress());
$element->addValidator('NotEmpty');
$element->setDescription('必填,将不会显示在您的帖子里');
if (isset($user)) {
$element->setValue($user->email);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('mobile');
$element->setLabel('您的手机号');
$element->addFilter(new Zend_Filter_HtmlEntities());
$element->addFilter(new Zend_Filter_StripTags());
$element->setDescription('方便其他用户联系您');
if (isset($user)) {
$element->setValue($user->mobile);
}
$this->addElement($element);
$this->addDisplayGroup(array('name', 'email', 'mobile'), 'aboutYou');
$this->getDisplayGroup('aboutYou')->removeDecorator('DtDdWrapper');
// radio box
$element = new Zend_Form_Element_Radio('type');
$element->addMultiOptions(array('lease' => '供', 'want' => '求'))->removeDecorator('Label');
$element->setSeparator('')->setValue(Advertisement::LEASE);
if (isset($this->advertisement)) {
$element->setValue($this->advertisement->type);
}
$this->addElement($element);
// category
$element = new Zend_Form_Element_Checkbox("isBusiness");
$element->setLabel('是商铺/店面吗?');
if (isset($this->advertisement) && $this->advertisement->category_id == Category::SHOP) {
$element->setValue(1);
} else {
$element->setValue(0);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('title');
$element->setLabel('帖子标题');
$element->setRequired(true);
$element->addValidator('NotEmpty');
//$element->addValidator(new Zend_Validate_StringLength(10,30));
$element->setDescription('必填,5-100字,概括题目,突出重点');
if (isset($this->advertisement)) {
$element->setValue($this->advertisement->title);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('address');
$element->setLabel('房子的住址');
$element->setDescription('必填,以便用户在地图上方便的找到');
if (isset($this->advertisement)) {
$element->setValue($this->advertisement->address);
}
$this->addElement($element);
$element = new Zend_Form_Element_Text('rent');
$element->setLabel('租金');
if (isset($this->advertisement)) {
$element->setValue($this->advertisement->rent);
}
$this->addElement($element);
$element = new Zend_Form_Element_Select('currency');
//$element->setLabel("货币");
$element->addMultiOptions(Currency::getAvailableCurrencyAsArray());
if (isset($this->advertisement)) {
$element->setValue(Advertisement::getCurrency($this->advertisement)->id);
} else {
$element->setValue(127);
}
$this->addElement($element);
$element = new Zend_Form_Element_Radio('rent_measurement');
$element->addMultiOptions(array('month' => '每月', 'day' => '每日'))->setSeparator('')->setDescription('必填')->removeDecorator('Label');
//.........这里部分代码省略.........