本文整理汇总了PHP中Zend_Form_SubForm::setDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_SubForm::setDescription方法的具体用法?PHP Zend_Form_SubForm::setDescription怎么用?PHP Zend_Form_SubForm::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_SubForm
的用法示例。
在下文中一共展示了Zend_Form_SubForm::setDescription方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('menu')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Menu Item Information');
$subForm1->setDescription('Menu Item Information');
$idField = new Zend_Form_Element_Hidden('id');
$title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
$title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
$link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
$open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
$open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
$status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
$sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
$sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$style_class = new Zend_Form_Element_Text('style_class');
$style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
$menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
$menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
$subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例2: init
public function init()
{
$this->setAttrib('id', 'customAttribute');
// Create and configure username element:
$label = $this->createElement('text', 'label', array('label' => 'Label:'));
$label->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags');
$description = $this->createElement('text', 'description', array('label' => 'Description:'));
$description->addFilter('StringTrim')->addFilter('StripTags');
$required = $this->createElement('select', 'required', array('label' => 'Required?'));
$required->setRequired(true)->setMultiOptions(array('1' => 'Yes', '0' => 'No'))->setAllowEmpty(false);
$rowCt = $this->createElement('hidden', 'rowCt');
$rowCt->setValue($this->_numberOfOptions);
$rowCt->setDecorators(array('ViewHelper'));
$this->addElements(array($label, $description, $required, $rowCt));
if ($this->_numberOfOptions != 0) {
$container = new Zend_Form_SubForm();
$container->setDescription('Options:');
$container->setDecorators(array(array('Description', array('tag' => 'label', 'class' => 'control-label')), array('FormElements'), array(array('controlsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'control-group', 'id' => 'optionElement'))));
$container->setElementDecorators(array('ViewHelper', 'FormElements'));
$this->addSubForm($container, 'options');
for ($i = 0; $i < $this->_numberOfOptions; $i++) {
$optionSubform = new Ot_Form_CustomAttributeOption();
$container->addSubForm($optionSubform, $i);
}
$this->addElement('button', 'addElement', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_SUCCESS, 'label' => 'Add Option', 'icon' => 'plus', 'whiteIcon' => true, 'iconPosition' => Twitter_Bootstrap_Form_Element_Button::ICON_POSITION_LEFT));
}
$this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Save Attribute'));
$this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button'));
$this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions')));
return $this;
}
示例3: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('cms_block')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Block Information');
$subForm1->setDescription('Block Information');
$idField = new Zend_Form_Element_Hidden('id');
$title = new Zend_Form_Element_Text('title', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$identifer = new Zend_Form_Element_Text('identifier_key', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$identifer->setRequired(true)->setLabel('Identifer Key')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$content = new Uni_Core_Form_Element_Editor('content', array('cols' => '50', 'rows' => '20', 'class' => 'required'));
$content->setRequired(true)->setLabel('Content');
$status = new Zend_Form_Element_Select('status', array('class' => 'required'));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('cms/block')->getAllStatuses());
$subForm1->addElements(array($idField, $title, $identifer, $content, $status));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例4: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('menugroup')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Menu Group Information');
$subForm1->setDescription('Menu Group Information');
$idField = new Zend_Form_Element_Hidden('id');
$name = new Zend_Form_Element_Text('name', array('class' => 'required', 'maxlength' => 200));
$name->setRequired(true)->setLabel('Name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menugroup')->getAllStatuses());
$sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
$sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$key = new Zend_Form_Element_Text('key', array('class' => 'required', 'maxlength' => 200));
$key->setRequired(true)->setLabel('Key')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$description = new Zend_Form_Element_Textarea('description', array('cols' => '60', 'rows' => '10'));
$subForm1->addElements(array($idField, $name, $sort_order, $key, $status, $description));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例5: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$userId = $this->getRequest()->getParam('id', FALSE);
$form->setName('admin_user')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('User Information');
$subForm1->setDescription('General User Information');
$subForm2 = new Zend_Form_SubForm();
$subForm2->setLegend('User Role');
$subForm2->setDescription('User Role');
$idField = new Zend_Form_Element_Hidden('id');
$username = new Zend_Form_Element_Text('username', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$username->setRequired(true)->setLabel('Username')->addFilter('StripTags')->addFilter('StringTrim')->setDescription('Username should be unique')->addValidator('NotEmpty');
$firstname = new Zend_Form_Element_Text('firstname', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$firstname->setRequired(true)->setLabel('First Name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$lastname = new Zend_Form_Element_Text('lastname', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$lastname->setRequired(true)->setLabel('Last Name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$password = new Zend_Form_Element_Password('password', array('size' => '30', 'maxlength' => 200, 'class' => !$userId ? 'required' : ''));
if (!$userId) {
$password->setRequired(true);
}
$password->setLabel('Password')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$cPassword = new Zend_Form_Element_Password('c_password', array('size' => '30', 'maxlength' => 200, 'class' => !$userId ? 'required' : ''));
if (!$userId) {
$cPassword->setRequired(true);
}
$cPassword->setLabel('Confirm Password')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$email = new Zend_Form_Element_Text('email', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$email->setRequired(true)->setLabel('Email ID')->addFilter('StripTags')->setDescription('Email ID should be unique')->addFilter('StringTrim')->addValidator('NotEmpty');
$contact = new Zend_Form_Element_Text('contact', array('size' => '30', 'maxlength' => 200));
$contact->setLabel('Contact')->addFilter('StripTags')->addFilter('StringTrim');
$status = new Zend_Form_Element_Select('status', array('class' => 'required'));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('admin/user')->getAllStatuses());
$roleId = new Zend_Form_Element_Select('role_id', array('class' => 'required'));
$roleId->setRequired(true)->setLabel('Role')->setMultiOptions(Fox::getModel('admin/role')->getUserRole());
$subForm1->addElements(array($idField, $username, $firstname, $lastname, $email, $password, $cPassword, $contact, $status));
$subForm2->addElements(array($roleId));
$form->addSubForm($subForm1, 'subform1');
$form->addSubForm($subForm2, 'subform2');
parent::_prepareForm($form);
}
示例6: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('contact_reply')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Contact Information');
$subForm1->setDescription('Contact Information');
$idField = new Zend_Form_Element_Hidden('id');
$name = new Zend_Form_Element_Text('name', array('size' => '30', 'maxlength' => 200, 'class' => 'required', 'readonly' => 'readonly'));
$name->setRequired(true)->setLabel('Name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$email = new Zend_Form_Element_Text('email', array('size' => '30', 'maxlength' => 200, 'class' => 'email required', 'readonly' => 'readonly'));
$email->setRequired(true)->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$subject = new Zend_Form_Element_Text('subject', array('size' => '30', 'maxlength' => 200, 'class' => 'required', 'readonly' => 'readonly'));
$subject->setRequired(true)->setLabel('Subject')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$message = new Zend_Form_Element_Textarea('message', array('cols' => '30', 'rows' => '5', 'class' => 'required', 'readonly' => 'readonly'));
$message->setRequired(true)->setLabel('Message')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$reply = new Zend_Form_Element_Textarea('reply_message', array('cols' => '30', 'rows' => '5', 'class' => 'required'));
$reply->setRequired(true)->setLabel('Reply Message')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$subForm1->addElements(array($idField, $name, $subject, $email, $message, $reply));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例7: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('change_password')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Change Member Password');
$subForm1->setDescription('Change Member Password');
$idField = new Zend_Form_Element_Hidden('id');
$emailFieldOptions = array('size' => '30', 'maxlength' => 200, 'class' => 'required email');
if ($this->getRequest()->getParam('id') && Fox::getModel('member/member')->load($this->getRequest()->getParam('id'))) {
$emailFieldOptions['readonly'] = 'readonly';
}
$emailId = new Zend_Form_Element_Text('email_id', $emailFieldOptions);
$emailId->setRequired(true)->setLabel('Email Id')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$password = new Zend_Form_Element_Password('password', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$password->setRequired(true)->setLabel('Password')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$cPassword = new Zend_Form_Element_Password('c_password', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$cPassword->setRequired(true)->setLabel('Confirm Password')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$subForm1->addElements(array($idField, $emailId, $password, $cPassword));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例8: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('cms_page')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Page Information');
$subForm1->setDescription('Page Information');
$subForm2 = new Zend_Form_SubForm();
$subForm2->setLegend('Layout Settings');
$subForm2->setDescription('Page Layout Settings');
$subForm3 = new Zend_Form_SubForm();
$subForm3->setLegend('Meta Data');
$subForm3->setDescription('Page Meta Data Information');
$idField = new Zend_Form_Element_Hidden('id');
$title = new Zend_Form_Element_Text('title', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$urlKey = new Zend_Form_Element_Text('url_key', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$urlKey->setRequired(true)->setLabel('Url Key')->addFilter('StripTags')->setDescription('Relative to Website Base URL')->addFilter('StringTrim')->addValidator('NotEmpty');
$content = new Uni_Core_Form_Element_Editor('content', array('cols' => '50', 'rows' => '20', 'class' => 'required'));
$content->setRequired(true)->setLabel('Content');
$layout = new Zend_Form_Element_Select('layout', array('class' => 'required'));
$layout->setLabel('Layout')->setRequired(true)->setMultiOptions(Fox::getModel('cms/page')->getAvailableLayouts());
$layoutUpdate = new Zend_Form_Element_Textarea('layout_update', array('cols' => '60', 'rows' => '10'));
$layoutUpdate->setLabel('Layout Update');
$metaKey = new Zend_Form_Element_Textarea('meta_keywords', array('cols' => '60', 'rows' => '5'));
$metaKey->setLabel('Meta Keywords')->addFilter('StripTags')->addFilter('StringTrim');
$metaDesc = new Zend_Form_Element_Textarea('meta_description', array('cols' => '60', 'rows' => '5'));
$metaDesc->setLabel('Meta Description')->addFilter('StripTags')->addFilter('StringTrim');
$status = new Zend_Form_Element_Select('status', array('class' => 'required'));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('cms/page')->getAllStatuses());
$subForm1->addElements(array($idField, $title, $urlKey, $content, $status));
$subForm2->addElements(array($layout, $layoutUpdate));
$subForm3->addElements(array($metaKey, $metaDesc));
$form->addSubForm($subForm1, 'subform1');
$form->addSubForm($subForm2, 'subform2');
$form->addSubForm($subForm3, 'subform3');
parent::_prepareForm($form);
}
示例9: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('admin_email_template')->setMethod('post');
$id = $this->getRequest()->getParam('id');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Email Template Information');
$subForm1->setDescription('Email Template Information');
$idField = new Zend_Form_Element_Hidden('id');
$templateName = new Zend_Form_Element_Select('template_name', array('onchange' => 'getTemplateRecord(this)'));
$templateName->setRequired(false)->setLabel('Template Name')->setDescription('Choose existing template to load its content')->setMultiOptions(Fox::getModel('core/email/template')->getAllTemplates());
$name = new Zend_Form_Element_Text('name', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$name->setRequired(true)->setLabel('Name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$subject = new Zend_Form_Element_Text('subject', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$subject->setRequired(true)->setLabel('Subject')->addValidator('NotEmpty');
$content = new Uni_Core_Form_Element_Editor('content', array('size' => '30', 'maxlength' => 200, 'class' => 'required'));
$content->setRequired(true)->setLabel('Content')->addValidator('NotEmpty');
if (!$id) {
$subForm1->addElements(array($idField, $templateName, $name, $subject, $content));
} else {
$subForm1->addElements(array($idField, $name, $subject, $content));
}
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}