本文整理汇总了PHP中Zend_Form_Element_Textarea::setLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Textarea::setLabel方法的具体用法?PHP Zend_Form_Element_Textarea::setLabel怎么用?PHP Zend_Form_Element_Textarea::setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Textarea
的用法示例。
在下文中一共展示了Zend_Form_Element_Textarea::setLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* (non-PHPdoc)
* @see Zend_Form#init()
*/
public function init()
{
$table = new Tri_Db_Table('activity');
$validators = $table->getValidators();
$filters = $table->getFilters();
$statusOptions = $table->fetchPairs('status', 'status');
$this->setAction('activity/index/save')->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->addValidators($validators['id'])->addFilters($filters['id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
$filters['title'][] = 'StripTags';
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Title')->addValidators($validators['title'])->addFilters($filters['title']);
$filters['description'][] = 'StripTags';
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 10)->setAllowEmpty(false);
if (!$statusOptions || isset($statusOptions[''])) {
$status = new Zend_Form_Element_Text('status');
} else {
$statusOptions = array_unique($statusOptions);
$status = new Zend_Form_Element_Select('status');
$status->addMultiOptions(array('' => '[select]') + $statusOptions)->setRegisterInArrayValidator(false);
}
$begin = new Zend_Form_Element_Text('begin');
$begin->setLabel('Begin')->setAttrib('class', 'date')->addFilters($filters['begin'])->addValidators($validators['begin'])->setAllowEmpty(false)->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
$end = new Zend_Form_Element_Text('end');
$end->setLabel('End')->setAttrib('class', 'date')->addFilters($filters['end'])->getPluginLoader('filter')->addPrefixPath('Tri_Filter', 'Tri/Filter');
$status->setLabel('Status')->addValidators($validators['status'])->addFilters($filters['status']);
$this->addElement($id)->addElement($title)->addElement($description)->addElement($begin)->addElement($end)->addElement($status)->addElement('submit', 'Save');
}
示例2: init
public function init()
{
$this->setName('send-tweet');
$e = new Zend_Form_Element_Text('latitude');
$e->setLabel('Latitude');
$e->addFilter('StringTrim');
$e->setAttrib('onblur', 'setMarkerFromForm()');
$e->addValidator(new Zend_Validate_Regex('/[-+0-9.]/'));
$e->setTranslator(new Zend_Translate_Adapter_Array(array('regexNotMatch' => 'Latitude is not valid'), 'en'));
$this->addElement($e);
$e = new Zend_Form_Element_Text('longitude');
$e->setLabel('Longitude');
$e->addFilter('StringTrim');
$e->setAttrib('onblur', 'setMarkerFromForm()');
$e->addValidator(new Zend_Validate_Regex('/[-+0-9.]/'));
$e->setTranslator(new Zend_Translate_Adapter_Array(array('regexNotMatch' => 'Longitude is not valid'), 'en'));
$this->addElement($e);
$e = new Zend_Form_Element_Textarea('tweet');
$e->setLabel('Tweet');
$e->setRequired(true);
$e->addFilter('StripTags');
$e->addFilter('StringTrim');
$e->addValidator(new Zend_Validate_StringLength(array('max' => 140)));
$e->setTranslator(new Zend_Translate_Adapter_Array(array('isEmpty' => 'Please supply the message to be tweeted', 'stringLengthTooLong' => 'No more than 140 characters please!'), 'en'));
$this->addElement($e);
$e = new Zend_Form_Element_Submit('send');
$e->setIgnore(true);
$e->setLabel('Tweet!');
$this->addElement($e);
}
示例3: init
public function init()
{
$languageFile = Zend_Registry::get('languageFile');
$translate = new Zend_Translate('array', $languageFile, 'zh_CN');
$this->setTranslator($translate);
$this->setMethod('POST');
$this->setName('contactForm');
$element = new Zend_Form_Element_Text('name');
$element->setLabel('怎么称呼您');
$this->addElement($element);
$element = new Zend_Form_Element_Text('email');
$element->setLabel('您的Email');
//$element->setRequired(true);
$this->addElement($element);
$element = new Elements();
$element->addReCaptcha($this);
$this->addDisplayGroup(array('name', 'email', 'captcha'), 'leftSection');
$this->getDisplayGroup('leftSection')->removeDecorator('DtDdWrapper');
$element = new Zend_Form_Element_Textarea('body');
$element->setLabel('想要开通城市地区和找房贴士,关于您的简单介绍');
$element->addPrefixPath('My_Validator', 'My/Validator/', 'validate');
$element->addValidator('FormValueNotNull', true);
//$element->setRequired(true);
$element->setAttrib('rows', 13);
$this->addElement($element);
$this->addDisplayGroup(array('body'), 'rightSection');
$this->getDisplayGroup('rightSection')->removeDecorator('DtDdWrapper');
$element = new Zend_Form_Element_Submit('post');
$element->removeDecorator('Label');
$this->addElement($element);
}
示例4: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('applog');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$timestamp = new Zend_Form_Element_Text('timestamp');
$timestamp->setLabel('timestamp');
$priorityName = new Zend_Form_Element_Text('priorityName');
$priorityName->setLabel('priorityName');
$priority = new Zend_Form_Element_Text('priority');
$priority->setLabel('priority');
$className = new Zend_Form_Element_Text('className');
$className->setLabel('className');
$message = new Zend_Form_Element_Textarea('message');
$message->setLabel('message');
$identity = new Zend_Form_Element_Text('identity');
$identity->setLabel('identity');
$httpReferer = new Zend_Form_Element_Textarea('HTTP_REFERER');
$httpReferer->setLabel('HTTP_REFERER');
$remoteAddr = new Zend_Form_Element_Text('REMOTE_ADDR');
$remoteAddr->setLabel('REMOTE_ADDR');
$requestMethod = new Zend_Form_Element_Text('REQUEST_METHOD');
$requestMethod->setLabel('REQUEST_METHOD');
$requestTime = new Zend_Form_Element_Text('REQUEST_TIME');
$requestTime->setLabel('REQUEST_TIME');
$mysqltimestamp = new Zend_Form_Element_Text('mysqltimestamp');
$mysqltimestamp->setLabel('mysqltimestamp');
$elements = array($id, $hash, $timestamp, $priorityName, $priority, $className, $message, $identity, $httpReferer, $remoteAddr, $requestMethod, $requestTime, $mysqltimestamp);
$this->addElements($elements);
$this->addElements(array($submit));
}
示例5: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$quan_trong = new Zend_Form_Element_Select('quan_trong');
$quan_trong->setLabel('Quan Trọng')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$image = new Zend_Form_Element_Image('image');
$image->setLabel('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$mo_ta_tom_tat = new Zend_Form_Element_Textarea('mo_ta_tom_tat');
$mo_ta_tom_tat->setLabel('Mô tả tóm tắt')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_tom_tat', 'class' => 'textarea', 'rows' => '4'));
$mo_ta_chi_tiet = new Zend_Form_Element_Textarea('mo_ta_chi_tiet');
$mo_ta_chi_tiet->setLabel('Mô tả chi tiết (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_chi_tiet', 'class' => 'text-input textarea'));
$pdf = new Zend_Form_Element_File('pdf');
$pdf->setLabel('Upload PDF')->setDescription('(*.pdf < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'tin-tuc', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($tieu_de, $quan_trong, $noi_bat, $photo, $image, $pdf, $trang_thai, $mo_ta_tom_tat, $mo_ta_chi_tiet, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'tin_tuc')), 'Form'));
}
示例6: init
public function init()
{
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name');
$name->setRequired(true);
$this->addElement($name);
$enabled = new Zend_Form_Element_Checkbox('enabled');
$enabled->setLabel('Is the action enabled ?');
$this->addElement($enabled);
$public = new Zend_Form_Element_Checkbox('public');
$public->setLabel('Is the action public ?');
$this->addElement($public);
$use_custom_route = new Zend_Form_Element_Checkbox('use_custom_route');
$use_custom_route->setLabel('Custom Route');
$this->addElement($use_custom_route);
$custom_route = new Zend_Form_Element_Text('route');
//$custom_route->setLabel('Custom Route');
$this->addElement($custom_route);
$desc = new Zend_Form_Element_Textarea('description');
$desc->cols = 40;
$desc->rows = 15;
$desc->setLabel('Description');
$desc->setRequired(false);
$this->addElement($desc);
parent::init();
}
示例7: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('WhatIDoForm');
// image, uploader
$image = new Zend_Form_Element_File('Image');
$image->setLabel('Image:')->setDestination('img/profile')->addValidator('Count', false, 1)->addValidator('Size', false, 10000000)->addValidator('Extension', false, 'jpg,png,gif')->addFilter('Rename', 'WhatIDo.jpg');
// PictureCaption, string
$pictureCaption = new Zend_Form_Element_Textarea('PictureCaption');
$pictureCaption->setLabel('Picture caption:')->setRequired();
// MainText, string
$mainText = new Zend_Form_Element_Textarea('MainText');
$mainText->setLabel('Main text:')->setRequired();
// FooterText, string
$footerText = new Zend_Form_Element_Textarea('FooterText');
$footerText->setLabel('Footer text:')->setRequired();
// LinkText, string
$linkText = new Zend_Form_Element_Text('LinkText');
$linkText->setLabel('Link text:')->setRequired();
// LinkUrl, string
$linkUrl = new Zend_Form_Element_Text('LinkUrl');
$linkUrl->setLabel('Link Url:')->setRequired();
// Submit button
$submit = new Zend_Form_Element_Submit('Submit');
$submit->setLabel('Submit');
$this->addElements(array($image, $pictureCaption, $mainText, $footerText, $linkText, $linkUrl, $submit));
}
示例8: init
public function init()
{
// attribs
$this->setAttribs(array('id' => 'form-site-contato'));
$this->setMethod('post');
$this->setAction('contato/');
// contato_nome
$contato_nome = new Zend_Form_Element_Text('contato_nome');
$contato_nome->setLabel("Nome:");
$contato_nome->setRequired();
$contato_nome->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!"));
$contato_nome->setAttrib('class', 'form-control');
$contato_nome->setAttrib('placeholder', 'Informe seu nome');
$contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// contato_email
$contato_email = new Zend_Form_Element_Text('contato_email');
$contato_email->setLabel("E-mail:");
$contato_email->setRequired();
$contato_email->addErrorMessages(array(Zend_Validate_EmailAddress::INVALID => "Email inválido!"));
$contato_email->addValidator('EmailAddress');
$contato_email->setAttrib('class', 'form-control');
$contato_email->setAttrib('placeholder', 'Informe seu email');
$contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// contato_mensagem
$contato_mensagem = new Zend_Form_Element_Textarea('contato_mensagem');
$contato_mensagem->setLabel("Mensagem:");
$contato_mensagem->setRequired();
$contato_mensagem->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!"));
$contato_mensagem->setAttrib('class', 'form-control');
$contato_mensagem->setAttrib('placeholder', 'Digite aqui sua mensagem');
$contato_mensagem->setAttrib('rows', 5);
$contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$this->addElements(array($contato_nome, $contato_email, $contato_mensagem));
parent::init();
}
示例9: init
public function init()
{
$this->setMethod('post');
$subject = new \Zend_Form_Element_Text('subject');
$message = new \Zend_Form_Element_Textarea('message');
$priorityId = new \Zend_Form_Element_Select('priorityId');
$categories = new \Zend_Form_Element_Select('categories', array('multiple' => true));
$file = new \Zend_Form_Element_File('file');
$submit = new \Zend_Form_Element_Button('submit');
$cancel = new \Zend_Form_Element_Button('cancel');
$subject->setLabel('Konu:')->setAttrib('placeholder', 'Konu giriniz!')->setAttrib('class', 'form-control')->setRequired(true)->setDescription('')->setErrorMessages(array('required' => 'Bu alan zorunludur!'));
$message->setLabel('Mesaj:')->setAttrib('placeholder', 'Mesaj giriniz!')->setAttrib('class', 'form-control')->setAttrib('rows', '5')->setRequired(true)->setDescription('')->setErrorMessages(array('required' => 'Bu alan zorunludur!'));
$priorityId->setLabel('Öncelik:')->setAttrib('placeholder', 'Öncelik seçiniz!')->setAttrib('class', 'form-control')->setRequired(true)->setDescription('')->setErrorMessages(array('required' => 'Bu alan zorunludur!'));
$categories->setLabel('Kategori:')->setAttrib('placeholder', 'Kategori seçiniz!')->setAttrib('class', 'form-control')->setRequired(true)->setDescription('')->setValidators(array('StringLength'))->setErrorMessages(array('StringLength' => 'En az bir adet seçmelisiniz!', 'reuqired' => 'Bu alan zorunludur'));
$file->setLabel('File')->setAttrib('enctype', 'multipart/form-data')->setAttrib('accept', 'image/*')->setAttrib('id', 'upload')->setDestination('/var/www/destek-sistemi/web/upload')->addValidator('Count', false, 1)->addValidator('Size', false, 8388608)->addValidator('Extension', false, 'png,jpg');
$submit->setLabel('Kaydet')->setAttrib('class', 'btn btn-lg btn-primary btn-block')->setAttrib('type', 'submit');
$cancel->setLabel('İptal')->setAttrib('class', 'btn btn-md btn-default btn-block')->setAttrib('type', 'reset');
//$hash->setIgnore(true);
// add elements
$this->addElements(array($subject, $message, $priorityId, $categories, $file, $submit, $cancel));
// add display group
$this->addDisplayGroup(array('subject', 'message', 'priorityId', 'categories', 'submit', 'cancel'), 'ticketForm');
// set decorators
\EasyBib_Form_Decorator::setFormDecorator($this, \EasyBib_Form_Decorator::BOOTSTRAP_MINIMAL, 'submit', 'cancel');
}
示例10: init
public function init()
{
$http_code = new Zend_Form_Element_Text('http_code');
$http_code->setLabel('HTTP Code');
$http_code->setRequired(false);
$this->addElement($http_code);
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name');
$name->setRequired(true);
$this->addElement($name);
$msg = new Zend_Form_Element_Textarea('message');
$msg->setLabel('Error Message');
$msg->setAttribs(array('rows' => 10, 'cols' => 40));
$msg->setRequired(true);
$this->addElement($msg);
/** Maybe next version will have it back.
$action = new Default_Model_Action;
$all = $action->getList();
$actions = new Zend_Form_Element_Multiselect('actions');
$actions->setLabel('Associated Actions with this Error');
$actions->setMultiOptions($all);
$actions->setAttrib('size', 8);
$this->addElement($actions);
*/
$desc = new Zend_Form_Element_Textarea('description');
$desc->cols = 40;
$desc->rows = 15;
$desc->setLabel('Description');
$desc->setRequired(false);
$this->addElement($desc);
$this->addElement(new Zend_Form_Element_Submit('submit'));
parent::init();
}
示例11: init
public function init()
{
/**
* @todo Localize
*/
$tr = Zend_Registry::get('tr');
$name = new Zend_Form_Element_Text('mimetype');
$name->setLabel($tr->_('MIMETYPE'));
$name->setRequired(true);
$name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
$this->addElement($name);
$name = new Zend_Form_Element_Text('output_format');
$name->setLabel($tr->_('OUTPUT_FORMAT'));
$name->setRequired(true);
$name->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
$this->addElement($name);
$desc = new Zend_Form_Element_Textarea('description');
$desc->cols = 35;
$desc->rows = 15;
$desc->setLabel($tr->_('DESCRIPTION'));
$desc->setRequired(false);
$this->addElement($desc);
$this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));
parent::init();
}
示例12: _bio
protected function _bio()
{
$e = new Zend_Form_Element_Textarea('bio');
$e->setLabel('Bio:')->setAttrib('rows', 5)->setAttrib('placeholder', _('Write a little about yourself...'))->addFilter('StripTags')->addFilter('StringTrim');
$e->setAttrib('class', 'form-control');
return $e;
}
示例13: init
public function init()
{
// contato_nome
$contato_nome = new Zend_Form_Element_Text("contato_nome");
$contato_nome->setLabel("Nome");
$contato_nome->setRequired();
$contato_nome->setAttribs(array('class' => 'form-control'));
$contato_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// contato_email
$contato_email = new Zend_Form_Element_Text("contato_email");
$contato_email->setLabel("E-mail");
$contato_email->setRequired();
$contato_email->setAttribs(array('class' => 'form-control'));
$contato_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// contato_assunto
$contato_assunto = new Zend_Form_Element_Select("contato_assunto");
$contato_assunto->setLabel("Assunto");
$contato_assunto->setRequired();
$contato_assunto->setAttribs(array('class' => 'form-control'));
$contato_assunto->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$contato_assunto->setMultiOptions(array("" => "Selecione o assunto...", "Informação" => "Informação", "Elogio" => "Eologio", "Crítica" => "Crítica", "Sugestão" => "Sugestão", "Outros" => "Outros"));
// contato_mensagem
$contato_mensagem = new Zend_Form_Element_Textarea("contato_mensagem");
$contato_mensagem->setLabel("mensagem");
$contato_mensagem->setRequired();
$contato_mensagem->setAttribs(array('class' => 'form-control', 'rows' => 5));
$contato_mensagem->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$this->addElements(array($contato_nome, $contato_email, $contato_assunto, $contato_mensagem));
parent::init();
}
示例14: init
public function init()
{
$this->setName('f2')->setMethod('post');
$nams = Default_Model_Constraints::nam();
$namOption = array("multiOptions" => $nams);
$nam = new Zend_Form_Element_Select('nam', $namOption);
$nam->setValue(date('Y'))->setLabel('Năm (*)')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'nam'));
$bizHDD = new Default_Model_Hdd();
$hdds = $bizHDD->getDSHDByNam(date('Y'));
if ($hdds == null) {
$hdsOptions = array("multiOptions" => array('-1' => '== Chưa thành lập =='));
} else {
$hdds = array('0' => '== Tất cả ==') + $hdds;
$hddsOptions = array("multiOptions" => $hdds);
}
$noi_nhan = new Zend_Form_Element_Select('noi_nhan', $hddsOptions);
$noi_nhan->setRequired(true)->setLabel('Hội đồng')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_nhan'))->setRegisterInArrayValidator(false);
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'ds-mail-tb'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($nam, $noi_nhan, $tieu_de, $noi_dung, $submit, $cancel));
$this->addDisplayGroup(array('submit', 'cancel'), 'btn_submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例15: __construct
public function __construct($options = null)
{
parent::__construct();
$this->setMethod('post');
$this->setEnctype('multipart/form-data');
//$this->setAction('');
$this->setName('custom_layout_advanced_form');
$this->addElementPrefixPath('Oibs_Form_Decorator', 'Oibs/Form/Decorator/', 'decorator');
$clearall = new Oibs_Form_Element_Note('clearall');
$clearall->setValue('<div style="clear:both;"></div>');
$csstextarea = new Zend_Form_Element_Textarea('csscontent');
$csstextarea->setLabel('Editable custom layout css for advanced users')->setAttrib('id', 'css_textarea')->setAttrib('style', 'width: 575px; height: 660px; margin-left: -5px; margin-right: 10px; margin-bottom: 10px;')->setValue($options['cssContent'])->addDecorator('Label', array('tag' => 'div', 'style' => '/*font-weight:bold;*/ float:left; margin-top:6px'))->addValidators(array(array('StringLength', false)));
$savecssbutton = new Zend_Form_Element_Submit('save_css_button');
$savecssbutton->setLabel('Save')->setAttrib('style', 'width:60px; float:right;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
$cancelcssbutton = new Zend_Form_Element_Button('cancel_css_button');
$cancelcssbutton->setLabel('Cancel')->setAttrib('style', 'width:60px; float:right; margin-right:10px')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
$defaultcssbutton = new Zend_Form_Element_Button('default_css_button');
$defaultcssbutton->setLabel('Default')->setAttrib('style', 'width:80px; float:left; margin-left: 10px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
$restorecssbutton = new Zend_Form_Element_Button('restore_css_button');
$restorecssbutton->setLabel('Restore')->setAttrib('style', 'width:80px; float:left; margin-left: -5px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper');
$defaultcsshidden = new Zend_Form_Element_Hidden('default_css');
$defaultcsshidden->setAttrib('id', 'default_css')->setValue($options['default_css']);
$originalcsshidden = new Zend_Form_Element_Hidden('original_css');
$originalcsshidden->setAttrib('id', 'original_css')->setValue($options['cssContent']);
$advancedhelp = new Oibs_Form_Element_Note('help_link_advanced');
$advancedhelp->setValue('<a href="#" onClick="return false;">Help</a>');
$this->addElements(array($csstextarea, $savecssbutton, $cancelcssbutton, $advancedhelp, $restorecssbutton, $defaultcssbutton, $defaultcsshidden, $originalcsshidden));
// Add decorators
$this->setDecorators(array('FormElements', 'Form'));
}