本文整理汇总了PHP中Zend_Form_Element_Text::setDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Text::setDecorators方法的具体用法?PHP Zend_Form_Element_Text::setDecorators怎么用?PHP Zend_Form_Element_Text::setDecorators使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Text
的用法示例。
在下文中一共展示了Zend_Form_Element_Text::setDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$this->setDecorators(array('PrepareElements', array('ViewScript', array('viewScript' => 'form/edit-history-item.phtml'))));
/*
$instance = new Zend_Form_Element_Select("instance_id");
$instance->setLabel(_("Choose Show Instance"));
$instance->setMultiOptions(array("0" => "-----------"));
$instance->setValue(0);
$instance->setDecorators(array('ViewHelper'));
$this->addElement($instance);
*/
$starts = new Zend_Form_Element_Text(self::ID_PREFIX . 'starts');
$starts->setValidators(array(new Zend_Validate_Date(self::VALIDATE_DATETIME_FORMAT)));
$starts->setAttrib('class', self::TEXT_INPUT_CLASS . " datepicker");
$starts->setAttrib('data-format', self::TIMEPICKER_DATETIME_FORMAT);
$starts->addFilter('StringTrim');
$starts->setLabel(_('Start Time'));
$starts->setDecorators(array('ViewHelper'));
$starts->setRequired(true);
$this->addElement($starts);
$ends = new Zend_Form_Element_Text(self::ID_PREFIX . 'ends');
$ends->setValidators(array(new Zend_Validate_Date(self::VALIDATE_DATETIME_FORMAT)));
$ends->setAttrib('class', self::TEXT_INPUT_CLASS . " datepicker");
$ends->setAttrib('data-format', self::TIMEPICKER_DATETIME_FORMAT);
$ends->addFilter('StringTrim');
$ends->setLabel(_('End Time'));
$ends->setDecorators(array('ViewHelper'));
//$ends->setRequired(true);
$this->addElement($ends);
}
示例2: _periodo_submissao_fim
protected function _periodo_submissao_fim()
{
$e = new Zend_Form_Element_Text('periodo_submissao_fim');
$e->setLabel(_('Submission ends in') . ":")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'form-control date');
$e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
return $e;
}
示例3: init
public function init()
{
// profissional_beleza_id
$profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id");
$profissional_beleza_id->setLabel("Selecione o profissional desejado: ");
$profissional_beleza_id->setRegisterInArrayValidator(false);
$profissional_beleza_id->setRequired();
$profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
// agenda_data
$agenda_data = new Zend_Form_Element_Text("agenda_data");
$agenda_data->setLabel("Selecione a data: ");
$agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off'));
$agenda_data->setRequired();
$agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// agenda_hora
$agenda_hora = new Zend_Form_Element_Select("agenda_hora");
$agenda_hora->setLabel('Selecione a hora: ');
$agenda_hora->setAttribs(array('class' => 'form-control'));
$agenda_hora->setMultiOptions(array('' => 'Horários'));
$agenda_hora->setRequired();
$agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$agenda_hora->setRegisterInArrayValidator(false);
// agenda_observacao
$agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao");
$agenda_observacao->setLabel("Observações: ");
$agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.'));
// salao_id
$salao_id = new Zend_Form_Element_Hidden('salao_id');
// especialidade_id
$especialidade_id = new Zend_Form_Element_Hidden("especialidade_id");
// usuario_id
$usuario_id = new Zend_Form_Element_Hidden("usuario_id");
$this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id));
parent::init();
}
示例4: init
public function init()
{
$this->setName('transfer_source');
$this->setAttrib('class', 'form-inline');
$host1 = new Zend_Form_Element_Text('host1');
$host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
$edit = new Zend_Form_Element_Hidden('edit');
//$edit->setLabel('Edition Mode');
//$edit->clearDecorators();
$host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$user1 = new Zend_Form_Element_Text('user1');
$user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
$user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$password1 = new Zend_Form_Element_Text('password1');
$password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$action = new Zend_Form_Element_Select('action');
$action->setOptions(array('1' => 'source', '2' => 'target'));
$action->setAttrib('class', 'form-control');
$action->options = array('1' => 'source', '2' => 'target');
$action->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-2'))));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Submit');
$submit->setAttrib('class', 'btn btn-default');
$submit->setAttrib('value', 'transfer_source');
$submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
$this->addElements(array($edit, $host1, $user1, $password1, $action, $submit));
$this->setDecorators(array('FormElements', 'Form'));
}
示例5: _nome_evento
protected function _nome_evento()
{
$e = new Zend_Form_Element_Text('nome_evento');
$e->setLabel(_('Title:'))->setRequired(true)->addValidator('StringLength', false, array(1, 100))->setAttrib("data-required", "true")->setAttrib("data-rangelength", "[1,100]")->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'form-control');
$e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
return $e;
}
示例6: init
/**
*
* Edit Album form
*
*/
public function init()
{
$cname = explode('_', get_class());
$this->preInit(end($cname));
// use template file
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/EditAlbum.phtml'))));
// get group from database
$request = Zend_Controller_Front::getInstance()->getRequest();
$album_id = $request->getParam('id');
$Albums = new Application_Model_Albums();
$album = $Albums->getAlbum($album_id);
$username_minchars = Zend_Registry::get('config')->get('username_minchars');
$username_maxchars = Zend_Registry::get('config')->get('username_maxchars');
// fields
$id = new Zend_Form_Element_Hidden('id');
$id->setValue($album);
$album_name = new Zend_Form_Element_Text('album_name');
$album_name->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Album Name'))->setRequired(true)->setValue($album['name'])->setAttrib('class', 'form-control');
$description = new Zend_Form_Element_Textarea('description');
$description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->addFilter('StripTags')->setValue($album['description'])->setLabel($this->translator->translate('About this album'))->setAttrib('class', 'form-control');
$submit = new Zend_Form_Element_Submit('formsubmit');
$submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default');
$this->addElements(array($id, $album_name, $description, $submit));
$this->postInit();
}
示例7: __construct
/**
* @author code generate
* @return mixed
*/
public function __construct($option = array())
{
$classId = new Zend_Form_Element_Hidden('UserId');
$classId->setDecorators(array('ViewHelper'));
$this->addElement($classId);
$email = new Zend_Form_Element_Text('Email');
$email->setLabel('Email *');
$email->addFilter('StringTrim');
$email->setRequired(true);
$email->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
$email->addValidator(new Zend_Validate_Db_NoRecordExists("Users", "Email"));
$email->addValidator('EmailAddress', true);
$email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Email không phù hợp")));
$this->addElement($email);
$save = new Zend_Form_Element_Submit('Save');
$save->setLabel('Đăng ký');
$save->setAttrib('class', 'btn btn-primary');
$save->setDecorators(array('ViewHelper'));
$this->addElement($save);
$reset = new Zend_Form_Element_Reset('Reset');
$reset->setLabel('Làm lại');
$reset->setAttrib('class', 'btn btn-primary');
$reset->setDecorators(array('ViewHelper'));
$this->addElement($reset);
}
示例8: getForm
function getForm()
{
$form = new Cible_Form(array('disabledDefaultActions' => true));
$base_dir = $this->getFrontController()->getBaseUrl();
$redirect = str_replace($base_dir, '', $this->_request->getParam('redirect'));
$form->setAction("{$base_dir}/auth/login")->setMethod('post');
$form->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
$form->setAttrib('class', 'auth-form');
$username = new Zend_Form_Element_Text('username');
$username->setLabel(Cible_Translation::getCibleText('form_label_username'));
$username->setRequired(true);
$username->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('error_field_required'))));
$username->setAttrib('class', 'loginTextInput');
$username->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'username')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'openOnly' => true))));
$form->addElement($username);
$password = new Zend_Form_Element_Password('password');
$password->setLabel(Cible_Translation::getCibleText('form_label_password'));
$password->setRequired(true);
$password->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('error_field_required'))));
$password->setAttrib('class', 'loginTextInput');
$password->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'password')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'closeOnly' => true))));
$form->addElement($password);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel(Cible_Translation::getCibleText('button_authenticate'))->setAttrib('class', 'loginButton')->setAttrib('onmouseover', 'this.className=\'loginButtonOver\';')->setAttrib('onmouseout', 'this.className=\'loginButton\';')->removeDecorator('label')->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => '2', 'align' => 'right', 'class' => 'submit')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$form->addElement($submit);
$redirect_hidden = new Zend_Form_Element_Hidden('redirect');
$redirect_hidden->setValue($redirect)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => '2')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$form->addElement($redirect_hidden);
return $form;
}
示例9: init
public function init()
{
$this->setName('param');
$this->setAttrib('class', 'form-inline');
$host1 = new Zend_Form_Element_Text('host1');
$host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
$host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row form-inline', 'openOnly' => true))));
$user1 = new Zend_Form_Element_Text('user1');
$user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
$user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
$password1 = new Zend_Form_Element_Text('password1');
$password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
$host2 = new Zend_Form_Element_Text('host2');
$host2->setAttrib('class', 'form-control')->setLabel('host2')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
$host2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row', 'openOnly' => true))));
$user2 = new Zend_Form_Element_Text('user2');
$user2->setLabel('user2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
$user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
$password2 = new Zend_Form_Element_Text('password2');
$password2->setLabel('pass2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Submit');
$submit->setAttrib('class', 'btn btn-default');
$submit->setAttrib('value', 'transfer_source');
$submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4 col-md-offset-4 text-center'))));
$this->addElements(array($host1, $user1, $password1, $host2, $user2, $password2, $submit));
$this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-inline')), 'Form'));
}
示例10: init
/**
*
* Change network background
*
*/
public function init()
{
$cname = explode('_', get_class());
$this->preInit(end($cname));
// use template file
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/SettingsBackground.phtml'))));
// load settings
$AppOptions = new Application_Model_AppOptions();
$all_meta = $AppOptions->getAllOptions();
// fields
$background_image = new Zend_Form_Element_File('background');
$background_image->setDecorators(array('File', 'Errors'))->setLabel($this->translator->translate('Choose Picture (jpg, png or gif)'))->addValidator('Extension', false, 'jpg,jpeg,png,gif');
$background_color = new Zend_Form_Element_Text('background_color');
$background_color->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue(isset($all_meta['background_color']) ? $all_meta['background_color'] : 'ff0000')->setErrorMessages(array($this->translator->translate('Please pick a color')))->setLabel($this->translator->translate('Background Color'))->setRequired(true)->setAttrib('class', 'form-control colorpicker-input');
$background_repeat = new Zend_Form_Element_Checkbox('background_repeat');
$background_repeat->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_repeat']) && $all_meta['background_repeat'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Repeat background'))->setCheckedValue("1")->setUncheckedValue("0");
$background_scroll = new Zend_Form_Element_Checkbox('background_scroll');
$background_scroll->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_scroll']) && $all_meta['background_scroll'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Scroll background'))->setCheckedValue("1")->setUncheckedValue("0");
$background_stretch = new Zend_Form_Element_Checkbox('background_stretch');
$background_stretch->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_stretch']) && $all_meta['background_stretch'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Stretch background'))->setCheckedValue("1")->setUncheckedValue("0");
$disable_image = new Zend_Form_Element_Checkbox('background_noimage');
$disable_image->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['background_noimage']) && $all_meta['background_noimage'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Disable custom image'))->setCheckedValue("1")->setUncheckedValue("0");
$submit = new Zend_Form_Element_Submit('formsubmit');
$submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default');
$this->addElements(array($background_image, $background_repeat, $background_scroll, $background_stretch, $disable_image, $background_color, $submit));
$this->postInit();
}
示例11: init
public function init()
{
$this->setName('transfer_target');
$this->setAttrib('class', 'form-inline');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$host2 = new Zend_Form_Element_Text('host2');
$host2->setAttrib('class', 'form-control')->setLabel('host2');
$host2->setDecorators(array('ViewHelper', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$user2 = new Zend_Form_Element_Text('user2');
$user2->setLabel('user2');
$user2->setAttrib('class', 'form-control');
$user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$password2 = new Zend_Form_Element_Text('password2');
$password2->setLabel('pass2');
$password2->setAttrib('class', 'form-control');
$password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Submit');
$submit->setAttrib('class', 'btn btn-default');
$submit->setValue('transfer_target');
$submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
$this->addElements(array($host2, $user2, $password2, $submit));
$this->setDecorators(array('FormElements', 'Form'));
}
示例12: _assinatura_email
protected function _assinatura_email()
{
$e = new Zend_Form_Element_Text('assinatura_email');
$e->setLabel('E-mail da assinatura:')->addValidator('StringLength', false, array(1, 70))->addValidator('EmailAddress', TRUE)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'ex. seuemail@host.com.br');
$e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
return $e;
}
示例13: init
/**
*
* Themes & styles
*
*/
public function init()
{
$cname = explode('_', get_class());
$this->preInit(end($cname));
// use template file
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/SettingsStyles.phtml'))));
// load settings
$AppOptions = new Application_Model_AppOptions();
$all_meta = $AppOptions->getAllOptions();
// fields
$themes_array = array('/bootstrap/css/bootstrap.min.css' => 'Bootstrap');
$css_theme = new Zend_Form_Element_Select('css_theme');
$css_theme->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($themes_array)->setErrorMessages(array($this->translator->translate('Please select')))->setLabel($this->translator->translate('Choose css theme'))->setRequired(true)->setValue(isset($all_meta['css_theme']) ? $all_meta['css_theme'] : 'bootstrap')->setAttrib('class', 'form-control');
$wide_layout = new Zend_Form_Element_Checkbox('wide_layout');
$wide_layout->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['wide_layout']) && $all_meta['wide_layout'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Extra-wide layout on large screens'))->setCheckedValue("1")->setUncheckedValue("0");
$cover_ysize = new Zend_Form_Element_Text('cover_ysize');
$cover_ysize->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Cover image height'))->setValidators(array('digits'))->setRequired(true)->setValue(isset($all_meta['cover_ysize']) ? $all_meta['cover_ysize'] : '220')->setAttrib('class', 'form-control');
$user_background = new Zend_Form_Element_Checkbox('user_background');
$user_background->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['user_background']) && $all_meta['user_background'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Users can have custom background image'))->setCheckedValue("1")->setUncheckedValue("0");
$subscriber_background = new Zend_Form_Element_Checkbox('subscriber_background');
$subscriber_background->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($all_meta['subscriber_background']) && $all_meta['subscriber_background'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Subscribers can have custom background image'))->setCheckedValue("1")->setUncheckedValue("0");
$custom_css = new Zend_Form_Element_Textarea('css_custom');
$custom_css->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '15')->setValue(isset($all_meta['css_custom']) ? $all_meta['css_custom'] : '')->setLabel($this->translator->translate('Custom css'))->setAttrib('class', 'form-control');
$submit = new Zend_Form_Element_Submit('submitbtn');
$submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Update'))->setAttrib('class', 'submit btn btn-default');
$this->addElements(array($css_theme, $wide_layout, $cover_ysize, $user_background, $subscriber_background, $custom_css, $submit));
$this->postInit();
}
示例14: init
public function init()
{
$this->setMethod('post');
$this->setAction('/login');
$this->setOptions(array('class' => 'niceform', 'id' => 'form1'));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
//$this->getDecorator('HtmlTag')->setOptions(array('tag' => 'fieldset'));
/*$this->setDecorators(array(
'Errors',
'FormElements',
array('HtmlTag', array('tag' => 'fieldset')),
'Form'
));*/
$username = new Zend_Form_Element_Text('username');
$username->setLabel('username');
$username->setRequired(true);
$username->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))));
$pass = new Zend_Form_Element_Password('password');
$pass->setlabel('password');
$pass->setRequired(true);
$pass->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))));
/*
$pass->setDecorators(array(
'ViewHelper',
'Errors',
array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')),
array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'prepend')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
));
*/
$submit = new Zend_Form_Element_Submit('login');
$submit->setLabel('login');
$submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$this->addElements(array($username, $pass, $submit));
}
示例15: 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();
}