本文整理匯總了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');
//.........這裏部分代碼省略.........