当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_SubForm::setDecorators方法代码示例

本文整理汇总了PHP中Zend_Form_SubForm::setDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_SubForm::setDecorators方法的具体用法?PHP Zend_Form_SubForm::setDecorators怎么用?PHP Zend_Form_SubForm::setDecorators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_SubForm的用法示例。


在下文中一共展示了Zend_Form_SubForm::setDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addTripLines

 public function addTripLines($tripCount = 1, $startDate, $buses = array())
 {
     // create subform
     $tripLinePanel = new Zend_Form_SubForm();
     $tripLinePanel->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'fieldsetForm span-8'));
     for ($i = 1; $i <= $tripCount; ++$i) {
         // create bus element
         $bus = $this->_createBusElement($buses);
         // create departure time element
         $departureTime = $this->_createElement('text', 'departureTime', 'Ngày giờ đi', 'Làm ơn nhập ngày giờ đi', true);
         $departureTime->setValue($startDate . ' 00:00:00');
         $departureTime->addValidator(new TBB_Validate_DepartureTime($startDate));
         // create arrival time element
         $arrivalTime = $this->_createElement('text', 'arrivalTime', 'Ngày giờ đến', 'Làm ơn nhập ngày giờ đến', true);
         $arrivalTime->setValue($startDate . ' 00:00:00');
         $arrivalTime->addValidator(new TBB_Validate_ArrivalTime());
         $fare = $this->_createElement('text', 'fare', 'Giá vé', 'Làm ơn nhập giá vé', false, true);
         // create trip line
         $tripLine = new Zend_Form_SubForm();
         $tripLine->setDecorators($this->_displayGroupDecorators)->addAttribs(array('class' => 'span-7'))->setLegend('Chuyến #' . $i);
         // add elements to the tripline
         $tripLine->addElements(array($bus, $departureTime, $arrivalTime, $fare));
         $tripLinePanel->addSubForm($tripLine, $i);
     }
     // add submit button
     $submit = $this->_createSubmitButton();
     $tripLinePanel->addElement($submit);
     $this->addSubForm($tripLinePanel, 'tripLines');
 }
开发者ID:rizkioa,项目名称:etak6,代码行数:29,代码来源:TripCreateMultipleCont.php

示例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;
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:31,代码来源:CustomAttribute.php

示例3: init

 public function init()
 {
     $this->setAction('/core/submit/new');
     $type = new Zend_Form_Element_MultiCheckbox('submission_type');
     $type->setLabel('')->setRequired(false)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('submission_type'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title')->setRequired(true)->addValidator('StringLength', true, array(2, 64, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer title', Zend_Validate_StringLength::TOO_LONG => 'Your title is too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 64 characters')->setAttrib('maxLength', 64)->setDecorators(array('Composite'));
     $audience = new Zend_Form_Element_Radio('target_audience');
     $audience->setLabel('Please mark the target audience for your presentation')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('target_audience'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $publish = new Zend_Form_Element_Radio('publish_paper');
     $publish->setLabel('Please indicate whether you wish to prepare a full paper for possible publication')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('publish_paper', 'submit'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $topicModel = new Core_Model_Topic();
     $topicsForSelect = $topicModel->getTopicsForSelect();
     $topicsel = new Zend_Form_Element_MultiCheckbox('topic');
     $topicsel->setLabel('Topic')->setRequired(false)->setAttrib('class', 'tiny')->setMultiOptions($topicsForSelect)->setSeparator('<br />')->setDecorators(array('Composite'));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords')->setRequired(false)->addValidator('StringLength', true, array(2, 500, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide longer keywords', Zend_Validate_StringLength::TOO_LONG => 'Your keywords are too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 500 characters')->setDecorators(array('Composite'));
     $abstract = new Zend_Form_Element_Textarea('abstract');
     $abstract->setLabel('Submission Summary (If your submission is accepted, this will be publicly visible!)')->setAttrib('class', 'small')->setDescription('Must be between 5 and 2000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 2000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer abstract', Zend_Validate_StringLength::TOO_LONG => 'Your abstract is too long')))->setDecorators(array('Composite'));
     $comment = new Zend_Form_Element_Textarea('comment');
     $comment->setLabel('Information for Reviewers')->setAttrib('class', 'small')->setDescription('Must be between 5 and 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 1000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer description', Zend_Validate_StringLength::TOO_LONG => 'Your description is too long')))->setDecorators(array('Composite'));
     $file = new TA_Form_Element_MagicFile('file');
     $file->setLabel('Your submission (File must be pdf and no bigger than 10Mb) *')->setRequired(false)->addDecorators($this->_magicFileElementDecorator)->addValidators(array(array('Count', true, 1), array('Size', true, 10000000), array('Extension', true, array('pdf', 'case' => true)), array('MimeType', false, array('application/pdf'))));
     $file->getValidator('Extension')->setMessage('Only pdf files are allowed!');
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($type, $file, $title, $audience, $topicsel, $keywords, $abstract, $comment));
     $this->addSubForm($subform, 'submission');
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:30,代码来源:Submit.php

示例4: indexAction

 public function indexAction()
 {
     // action body
     $idEncuesta = $this->getParam("idEncuesta");
     $encuesta = $this->encuestaDAO->obtenerEncuesta($idEncuesta);
     $secciones = $this->seccionDAO->obtenerSecciones($idEncuesta);
     $formulario = new Zend_Form($encuesta->getHash());
     //debemos agregar a este formulario campos para identificar quien es el que esta llenando esta encuesta
     $eSubCabecera = new Zend_Form_SubForm();
     $eSubCabecera->setLegend("Datos Personales: ");
     $eEncuesta = new Zend_Form_Element_Hidden("idEncuesta");
     $eEncuesta->setValue($idEncuesta);
     $eReferencia = new Zend_Form_Element_Text("referencia");
     $eReferencia->setLabel("Boleta o Clave : ");
     $eReferencia->setAttrib("class", "form-control");
     $eReferencia->setDecorators($this->decoratorsPregunta);
     $eSubCabecera->addElements(array($eEncuesta, $eReferencia));
     $eSubCabecera->setDecorators($this->decoratorsSeccion);
     $formulario->addSubForm($eSubCabecera, "referencia");
     //============================================= Iteramos a traves de las secciones del grupo
     foreach ($secciones as $seccion) {
         //============================================= Cada seccion es una subforma
         $subFormSeccion = new Zend_Form_SubForm($seccion->getHash());
         $subFormSeccion->setLegend("Sección: " . $seccion->getNombre());
         //============================================= Obtenemos los elemntos de la seccion
         $elementos = $this->seccionDAO->obtenerElementos($seccion->getIdSeccion());
         foreach ($elementos as $elemento) {
             //============================================= Verificamos que tipo de elemento es
             if ($elemento instanceof Encuesta_Model_Pregunta) {
                 //============================================= Aqui ya la agregamos a la seccion
                 $this->agregarPregunta($subFormSeccion, $elemento);
             } elseif ($elemento instanceof Encuesta_Model_Grupo) {
                 //============================================= un grupo es otra subform
                 $subFormGrupo = new Zend_Form_SubForm($elemento->getHash());
                 $subFormGrupo->setLegend("Grupo: " . $elemento->getNombre());
                 $preguntasGrupo = $this->grupoDAO->obtenerPreguntas($elemento->getIdGrupo());
                 foreach ($preguntasGrupo as $pregunta) {
                     //============================================= Aqui ya la agregamos al grupo
                     $this->agregarPregunta($subFormGrupo, $pregunta);
                 }
                 $subFormGrupo->setDecorators($this->decoratorsGrupo);
                 $subFormSeccion->addSubForm($subFormGrupo, $elemento->getIdGrupo());
             }
         }
         $subFormSeccion->setDecorators($this->decoratorsSeccion);
         $formulario->addSubForm($subFormSeccion, $seccion->getIdSeccion());
     }
     $eSubmit = new Zend_Form_Element_Submit("submit");
     $eSubmit->setLabel("Enviar Encuesta");
     $eSubmit->setAttrib("class", "btn btn-success");
     $formulario->addElement($eSubmit);
     $formulario->setDecorators($this->formDecorators);
     $this->view->encuesta = $encuesta;
     $this->view->formulario = $formulario;
 }
开发者ID:blackgios,项目名称:General,代码行数:55,代码来源:GeneradorController.php

示例5: addItemXpathsToExtend

 protected function addItemXpathsToExtend($itemXpathsToExtend)
 {
     if (count($itemXpathsToExtend) == 0) {
         $itemXpathsToExtend = array(new Kaltura_Client_Type_ExtendingItemMrssParameter());
     }
     $mainSubForm = new Zend_Form_SubForm();
     $mainSubForm->setLegend('Item XPaths To Extend');
     $mainSubForm->setDecorators(array('FormElements', array('ViewScript', array('viewScript' => 'distribution-item-xpath-to-extend.phtml', 'placement' => 'APPEND')), 'Fieldset'));
     $i = 1;
     $extendCategory = false;
     $extendParentCategory = false;
     foreach ($itemXpathsToExtend as $itemXPath) {
         /* @var $itemXPath Kaltura_Client_Type_ExtendingItemMrssParameter */
         //if it a category identifier
         if ($itemXPath->identifier instanceof Kaltura_Client_Type_CategoryIdentifier) {
             /* @var $identifier Kaltura_Client_Type_CategoryIdentifier */
             $identifier = $itemXPath->identifier;
             //if the parameters are set exactly as the admin console sets.
             if ($itemXPath->xpath == '//category' && $itemXPath->extensionMode == Kaltura_Client_Enum_MrssExtensionMode::REPLACE && $identifier->identifier == Kaltura_Client_Enum_CategoryIdentifierField::FULL_NAME) {
                 foreach (explode(',', $identifier->extendedFeatures) as $extendedFeature) {
                     if ($extendedFeature == Kaltura_Client_Enum_ObjectFeatureType::METADATA) {
                         $extendCategory = true;
                     } elseif ($extendedFeature == Kaltura_Client_Enum_ObjectFeatureType::ANCESTOR_RECURSIVE) {
                         $extendParentCategory = true;
                     }
                 }
             }
             continue;
         }
         $subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
         $subForm->setDecorators(array('FormElements'));
         $subForm->addElement('text', 'itemXpathsToExtend', array('decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div'))), 'isArray' => true, 'value' => $itemXPath->xpath));
         $mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++);
     }
     //set the extend category metadata checkbox
     $subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
     $subForm->setDecorators(array('FormElements'));
     $subForm->addElement('checkbox', 'includeCategoryInMrss', array('label' => 'Include category-level custom metadata in MRSS', 'isArray' => true, 'value' => $extendCategory));
     $subForm->getElement('includeCategoryInMrss')->getDecorator('Label')->setOption('placement', 'APPEND');
     $subForm->getElement('includeCategoryInMrss')->setChecked($extendCategory);
     $mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++, 99);
     //set the extend category parent metadata checkbox
     $subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
     $subForm->setDecorators(array('FormElements'));
     $subForm->addElement('checkbox', 'includeCategoryParentInMrss', array('label' => 'Include parent categories', 'isArray' => true, 'value' => $extendParentCategory));
     $subForm->getElement('includeCategoryParentInMrss')->getDecorator('Label')->setOption('placement', 'APPEND');
     $subForm->getElement('includeCategoryParentInMrss')->setChecked($extendParentCategory);
     $mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++, 100);
     $this->addSubForm($mainSubForm, 'itemXpathsToExtend_group');
 }
开发者ID:DBezemer,项目名称:server,代码行数:50,代码来源:ConfigurableProfileConfiguration.php

示例6: init

 public function init()
 {
     $this->setName('addApplicant');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $product = new Zend_Form_Element_Text('product');
     $product->setLabel('* product:')->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
     $category = new Zend_Form_Element_Text('category');
     $category->setLabel("* category:")->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
     $group = new Zend_Form_Element_Text('group');
     $group->setLabel("* group:")->setRequired(true)->addFilter('StripTags')->addFilter('stringTrim')->addValidators(array(array('regex', false, array('pattern' => "/^[а,б,в,г,ґ,д,е,є,ж,з,и,ы,і,ї,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ь,ю,я,А,Б,В,С,Г,Д,Е,Є,Ж,З,И,Ы,І,Ї,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ь,Ю,Я,A,a,B,b,C,c,D,d,E,e,F,f,G,g,H,h,I,i,J,j,K,k,L,l,M,m,N,n,O,o,P,p,Q,q,R,r,S,s,T,t,U,u,V,v,W,w,X,x,Y,y,Z,z,1,2,3,4,5,6,7,8,9,0'.]{2,}\$/", 'messages' => 'В полі присутні заборонені символи!!'))));
     $this->addElements(array($id, $product, $category, $group));
     //-------------------- add attr
     $institutions = new Zend_Form_SubForm();
     $institutions->setName('attr');
     $session = new Zend_Session_Namespace('form');
     foreach ($session->attr as $inst) {
         $rowForm = new Zend_Form_SubForm();
         $rowForm->setName($inst);
         if ($inst === '__template1__') {
             $rowForm->setAttrib('style', 'display: none;');
         }
         $instName = new Zend_Form_Element_Text('instName');
         $instName->setLabel('attribute')->addFilter('StripTags')->addFilter('stringTrim')->setAttrib('class', 'institution')->setAttrib('onfocus', 'institutionAutocomplete(this)');
         if ($inst !== '__template1__') {
             $instName->setRequired(true);
         }
         $inst_remove = new Zend_Form_Element_Button('remove');
         $inst_remove->setLabel('remove')->setAttrib('class', 'remove')->setAttrib('onclick', 'removeInst(this)');
         $elements = array($instName, $inst_remove);
         foreach ($elements as $element) {
             if ($inst !== '__template1__' && $element->getName() !== 'remove') {
                 $element->setRequired(true);
             }
         }
         $rowForm->addElements($elements);
         $rowForm->setElementDecorators($this->getElementDecorators());
         $rowForm->getElement('remove')->removeDecorator('Label');
         $rowForm->setDecorators($this->getSubFormDecorators());
         $institutions->addSubForm($rowForm, $inst);
     }
     $institutions->setDecorators($this->getSubFormDecorators());
     $inst_add = new Zend_Form_Element_Button('addInst');
     $inst_add->setLabel('add attribute')->setAttrib('class', 'addInst');
     $institutions->addElement($inst_add);
     $institutions->setElementDecorators($this->getElementDecorators());
     $institutions->getElement('addInst')->removeDecorator('Label');
     $this->addSubForm($institutions, 'institutions');
     $this->postSetup();
 }
开发者ID:varrbor,项目名称:hanuka.lviv.ua,代码行数:50,代码来源:SubForm.php

示例7: addItemXpathsToExtend

 protected function addItemXpathsToExtend($itemXpathsToExtend)
 {
     if (count($itemXpathsToExtend) == 0) {
         $itemXpathsToExtend = array(new Kaltura_Client_Type_String());
     }
     $mainSubForm = new Zend_Form_SubForm();
     $mainSubForm->setLegend('Item XPaths To Extend');
     $mainSubForm->setDecorators(array('FormElements', array('ViewScript', array('viewScript' => 'distribution-item-xpath-to-extend.phtml', 'placement' => 'APPEND')), 'Fieldset'));
     $i = 1;
     foreach ($itemXpathsToExtend as $stringObject) {
         $subForm = new Zend_Form_SubForm(array('disableLoadDefaultDecorators' => true));
         $subForm->setDecorators(array('FormElements'));
         $subForm->addElement('text', 'itemXpathsToExtend', array('decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div'))), 'isArray' => true, 'value' => $stringObject->value));
         $mainSubForm->addSubForm($subForm, 'itemXpathsToExtend_subform_' . $i++);
     }
     $this->addSubForm($mainSubForm, 'itemXpathsToExtend_group');
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:ConfigurableProfileConfiguration.php

示例8: init

 public function init()
 {
     parent::init();
     $this->setAction('/core/conference/timeslots');
     $conferenceId = new Zend_Form_Element_Hidden('conference_id');
     $conferenceId->setRequired(true)->addValidators(array('Int'))->setDecorators($this->_hiddenElementDecorator);
     $timeslot = new TA_Form_Element_Timeslot('timeslot_1');
     $timeslot->clearDecorators()->addDecorator(new TA_Form_Decorator_Timeslot())->setIgnore(true)->setAttrib('class', 'hidden');
     // since this element will be used as a template, hide it!
     // add timeslot elements to subform so in isValid() I only have to loop over that form
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($timeslot));
     $this->addSubForm($subform, 'dynamic');
     $this->addElements(array($conferenceId));
     $this->addElement('button', 'add', array('label' => 'Add new timeslot', 'decorators' => $this->_buttonElementDecorator));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:18,代码来源:Timeslots.php

示例9: init

 public function init()
 {
     $this->setAction('/core/submit/new');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title of paper')->setRequired(true)->addValidator('StringLength', true, array(2, 150, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer title', Zend_Validate_StringLength::TOO_LONG => 'Your title is too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 150 characters')->setDecorators(array('Composite'));
     $audience = new Zend_Form_Element_Radio('target_audience');
     $audience->setLabel('Please mark the target audience for your presentation')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('target_audience'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $publish = new Zend_Form_Element_Radio('publish_paper');
     $publish->setLabel('Please indicate whether you wish to prepare a full paper for possible publication')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('publish_paper', 'submit'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $topicsel = new Zend_Form_Element_Radio('topic');
     $topicsel->setLabel('Topic')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('topic'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords')->setRequired(false)->addValidator('StringLength', true, array(2, 500, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide longer keywords', Zend_Validate_StringLength::TOO_LONG => 'Your keywords are too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 500 characters')->setDecorators(array('Composite'));
     $comment = new Zend_Form_Element_Textarea('comment');
     $comment->setLabel('Comment')->setAttrib('class', 'small')->setDescription('Must be between 5 and 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 1000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer description', Zend_Validate_StringLength::TOO_LONG => 'Your description is too long')))->setDecorators(array('Composite'));
     $file = new TA_Form_Element_MagicFile('file');
     $file->setLabel('Your submission')->setRequired(true)->addDecorators($this->_magicFileElementDecorator)->setDescription('File must be a maximum of 10Mb')->addValidators(array(array('Count', true, 1), array('Size', true, 10000000)));
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($title, $audience, $publish, $topicsel, $keywords, $comment, $file));
     $this->addSubForm($subform, 'submission');
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
开发者ID:GEANT,项目名称:CORE,代码行数:23,代码来源:Submit.php

示例10: setMultiLanguage

 public function setMultiLanguage($key = true)
 {
     if ($key) {
         $languages = new Languages();
         $langAll = $languages->fetchAll();
         if ($langAll->count()) {
             $elements = $this->getElements();
             $subFrms = array();
             foreach ($langAll as $lang) {
                 $sf = new Zend_Form_SubForm();
                 foreach ($elements as $element) {
                     if (preg_match('/translate/', $element->getAttrib('class'))) {
                         $newElement = clone $element;
                         $newElement->setAttrib('id', $lang->codigo . '-' . $newElement->getName());
                         $sf->addElement($newElement);
                     }
                 }
                 $sf->setDecorators($this->getDecorators());
                 $subFrms[$lang->codigo] = $sf;
             }
             $this->addSubForms($subFrms);
         }
     }
     return $this;
 }
开发者ID:agenciaaeh,项目名称:kahina,代码行数:25,代码来源:Form.php

示例11: testPrepareSubFormDecoratorsForTableRendering

 public function testPrepareSubFormDecoratorsForTableRendering()
 {
     $method = new ReflectionMethod('Admin_Form_Document_MultiSubForm', 'prepareSubFormDecorators');
     $method->setAccessible(true);
     $columns = array(array(), array('label' => 'Number'), array('label' => 'SortOrder'));
     $form = new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Series', 'Series', null, array('columns' => $columns));
     $subform = new Zend_Form_SubForm();
     $subform->addPrefixPath('Application_Form_Decorator', 'Application/Form/Decorator', Zend_Form::DECORATOR);
     $subform->setDecorators(array());
     $subform->addElement('text', 'test', array('decorators' => array(array('dataWrapper' => 'HtmlTag'), array('LabelNotEmpty' => 'HtmlTag'), array('ElementHtmlTag' => 'HtmlTag'))));
     $subform->addElement('hidden', 'Id');
     $method->invoke($form, $subform);
     $this->assertEquals(1, count($subform->getDecorators()));
     $this->assertNotNull($subform->getDecorator('tableRowWrapper'));
     $element = $subform->getElement('test');
     $this->assertFalse($element->getDecorator('dataWrapper'));
     $this->assertFalse($element->getDecorator('LabelNotEmpty'));
     $this->assertFalse($element->getDecorator('ElementHtmlTag'));
     $this->assertNotNull($element->getDecorator('tableCellWrapper'));
     $this->assertEquals(0, count($subform->getElement('Id')->getDecorators()));
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:21,代码来源:MultiSubFormTest.php

示例12: addRoleCheckboxes

 public function addRoleCheckboxes($userID = null)
 {
     ///////////////////// create role checkboxes /////////////////////
     // get role array
     $roleModel = new Admin_Model_Role();
     $roleArray = $roleModel->getRoleArray();
     // create subform
     $subForm = new Zend_Form_SubForm(array('class' => 'roleGroup'));
     $subForm->setDecorators($this->_displayGroupDecorators);
     $subForm->setOptions(array('class' => 'fieldsetForm span-7'));
     // this case is for updating user
     if ($userID) {
         $checkboxes = $this->_createCheckboxesForUpdatingUser($userID);
     } else {
         $checkboxes = $this->_createCheckboxesForCreatingUser();
     }
     $subForm->addElements($checkboxes);
     $this->addSubForm($subForm, 'roles');
 }
开发者ID:rizkioa,项目名称:etak6,代码行数:19,代码来源:Users.php

示例13: _setSubFormDecorators

 /**
  * Adds decorators to a subform.
  *
  * @param Zend_Form_SubForm $subForm The subform
  */
 protected function _setSubFormDecorators($subForm)
 {
     // Get rid of the fieldset tag that wraps subforms by default.
     $subForm->setDecorators(array('FormElements'));
     // Each subform is a row in the table.
     foreach ($subForm->getElements() as $el) {
         $el->setDecorators(array(array('decorator' => 'ViewHelper'), array('decorator' => 'HtmlTag', 'options' => array('tag' => 'td'))));
     }
 }
开发者ID:bulldozer2003,项目名称:CsvImport,代码行数:14,代码来源:Mapping.php

示例14: form

 public function form($values = array())
 {
     $config = Zend_Registry::get('config');
     $form = new Zend_Form();
     $form->setAttrib('id', 'eventForm')->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'zend_form')), 'Form'));
     $workshop = new Workshop();
     $where = $workshop->getAdapter()->quoteInto('status = ?', 'enabled');
     $workshops = $workshop->fetchAll($where, 'title');
     $workshopList = array();
     foreach ($workshops as $w) {
         $workshopList[$w->workshopId] = $w->title;
     }
     $workshopElement = $form->createElement('select', 'workshop', array('label' => 'Workshop:'));
     $workshopElement->setMultiOptions($workshopList)->setValue(isset($values['workshopId']) ? $values['workshopId'] : '');
     $location = new Location();
     $where = $location->getAdapter()->quoteInto('status = ?', 'enabled');
     $locations = $location->fetchAll($where, 'name');
     $locationList = array();
     $locationCapacity = array();
     foreach ($locations as $l) {
         $locationList[$l->locationId] = $l->name;
         $locationCapacity['loc_' . $l->locationId] = $l->capacity;
     }
     $locationIds = array_keys($locationList);
     // add the location capacities to the page in js so we can process it as a json object for the "live" max size changing with location selection
     Zend_Layout::getMvcInstance()->getView()->headScript()->appendScript('var locationCapacitiesString = ' . Zend_Json::encode($locationCapacity) . ';');
     $locationElement = $form->createElement('select', 'location', array('label' => 'Location:'));
     $locationElement->setMultiOptions($locationList)->setValue(isset($values['locationId']) ? $values['locationId'] : $locationCapacity['loc_' . $locationIds[0]]);
     $date = $form->createElement('text', 'date', array('label' => 'Date:'));
     $date->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '128')->setAttrib('style', 'width: 200px')->setValue(isset($values['date']) ? strftime('%A, %B %e, %Y', strtotime($values['date'])) : '');
     $password = $form->createElement('text', 'password', array('label' => 'Event Password:'));
     $password->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '100')->setValue(isset($values['password']) ? $values['password'] : '');
     // add the start time selector
     $startTimeSub = new Zend_Form_SubForm();
     $startTimeSub->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'zend_form'))));
     $startTimeSub->setAttrib('class', 'sub');
     $startTimeHour = $startTimeSub->createElement('select', 'hour', array('label' => 'Start Time:'));
     for ($i = 1; $i <= 12; $i++) {
         $startTimeHour->addMultiOption($i, $i);
     }
     $startTimeHour->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label')));
     $startTimeHour->setValue(isset($values['startTime']) ? date('g', strtotime($values['startTime'])) : date('g'));
     $startTimeMinute = $startTimeSub->createElement('select', 'minute');
     for ($i = 0; $i < 60; $i += 5) {
         $startTimeMinute->addMultiOption(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT));
     }
     $startTimeMinute->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect'))));
     $startTimeMinute->setValue(isset($values['startTime']) ? date('i', strtotime($values['startTime'])) : date('i'));
     $startTimeMeridian = $startTimeSub->createElement('select', 'meridian');
     $startTimeMeridian->addMultiOption('am', 'AM')->addMultiOption('pm', 'PM')->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect'))));
     $startTimeMeridian->setValue(isset($values['startTime']) ? date('a', strtotime($values['startTime'])) : date('a'));
     $startTimeSub->addElements(array($startTimeHour, $startTimeMinute, $startTimeMeridian));
     // add the end time selector
     $endTimeSub = new Zend_Form_SubForm();
     $endTimeSub->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'zend_form'))));
     $endTimeSub->setAttrib('class', 'sub');
     $endTimeHour = $endTimeSub->createElement('select', 'hour', array('label' => 'End Time:'));
     for ($i = 1; $i <= 12; $i++) {
         $endTimeHour->addMultiOption($i, $i);
     }
     $endTimeHour->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label')));
     $endTimeHour->setValue(isset($values['endTime']) ? date('g', strtotime($values['endTime'])) : date('g'));
     $endTimeMinute = $endTimeSub->createElement('select', 'minute');
     for ($i = 0; $i < 60; $i += 5) {
         $endTimeMinute->addMultiOption(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT));
     }
     $endTimeMinute->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect'))));
     $endTimeMinute->setValue(isset($values['endTime']) ? date('i', strtotime($values['endTime'])) : date('i'));
     $endTimeMeridian = $endTimeSub->createElement('select', 'meridian');
     $endTimeMeridian->addMultiOption('am', 'AM')->addMultiOption('pm', 'PM')->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect'))));
     $endTimeMeridian->setValue(isset($values['endTime']) ? date('a', strtotime($values['endTime'])) : date('a'));
     $endTimeSub->addElements(array($endTimeHour, $endTimeMinute, $endTimeMeridian));
     // get all the users available for the instructor list
     $otAccount = new Ot_Account();
     $accounts = $otAccount->fetchAll(null, array('lastName', 'firstName'))->toArray();
     $instructorList = array();
     foreach ($accounts as $a) {
         $instructorList[$a['accountId']] = $a['lastName'] . ", " . $a['firstName'];
     }
     $instructorElement = $form->createElement('multiselect', 'instructors', array('label' => 'Instructor(s):'));
     $instructorElement->setMultiOptions($instructorList)->setAttrib('size', 10)->setValue(isset($values['instructorIds']) ? $values['instructorIds'] : '');
     $minSize = $form->createElement('text', 'minSize', array('label' => 'Min Size:'));
     $minSize->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '64')->setAttrib('style', 'width: 50px;')->setValue(isset($values['minSize']) ? $values['minSize'] : $config->user->defaultMinWorkshopSize->val);
     $maxSize = $form->createElement('text', 'maxSize', array('label' => 'Max Size:'));
     $maxSize->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '64')->setAttrib('style', 'width: 50px;')->setValue(isset($values['maxSize']) ? $values['maxSize'] : $locationElement->getValue());
     $waitlistSize = $form->createElement('text', 'waitlistSize', array('label' => 'Waitlist Size:'));
     $waitlistSize->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '64')->setAttrib('style', 'width: 50px;')->setValue(isset($values['waitlistSize']) ? $values['waitlistSize'] : $config->user->defaultWorkshopWaitlistSize->val);
     $evaluationType = $form->createElement('select', 'evaluationType', array('label' => 'Evaluation Type:'));
     $evaluationType->setMultiOptions(array('default' => 'Default', 'google' => 'Google Form'))->setRequired(true)->setValue(isset($values['evaluationType']) ? $values['evaluationType'] : 'default');
     $formKey = $form->createElement('textarea', 'formKey', array('label' => 'Google Form Question Key:'));
     $formKey->setAttribs(array('cols' => '10', 'rows' => '5', 'style' => 'width : 250px;'))->addDecorators(array('ViewHelper', 'Errors', 'HtmlTag', array('Label', array('tag' => 'span')), array(array('elementDiv' => 'HtmlTag'), array('tag' => 'div', 'id' => 'formKey', 'class' => 'elm'))))->setValue(isset($values['formKey']) ? $values['formKey'] : '');
     $answerKey = $form->createElement('textarea', 'answerKey', array('label' => 'Google Form Answer Key:'));
     $answerKey->addFilter('StringTrim')->addFilter('StripTags')->setAttribs(array('cols' => '10', 'rows' => '3', 'style' => 'width : 250px;'))->addDecorators(array('ViewHelper', 'Errors', 'HtmlTag', array('Label', array('tag' => 'span')), array(array('elementDiv' => 'HtmlTag'), array('tag' => 'div', 'id' => 'answerKey', 'class' => 'elm'))))->setValue(isset($values['answerKey']) ? $values['answerKey'] : '');
     $submit = $form->createElement('submit', 'submitButton', array('label' => 'Submit'));
     $submit->setDecorators(array(array('ViewHelper', array('helper' => 'formSubmit'))));
     $cancel = $form->createElement('button', 'cancel', array('label' => 'Cancel'));
     $cancel->setAttrib('id', 'cancel');
     $cancel->setDecorators(array(array('ViewHelper', array('helper' => 'formButton'))));
     $form->addElements(array($workshopElement, $locationElement, $password, $date, $evaluationType))->addSubForms(array('startTime' => $startTimeSub, 'endTime' => $endTimeSub))->addElements(array($minSize, $maxSize, $waitlistSize, $instructorElement));
     $form->addDisplayGroup(array('instructors'), 'instructors-group', array('legend' => 'Instructors'));
//.........这里部分代码省略.........
开发者ID:ncsuwebdev,项目名称:classmate,代码行数:101,代码来源:Event.php

示例15: init

 public function init()
 {
     // Set the form name, method and action
     $this->setAttrib('name', 'registerForm');
     $this->setAttrib('method', 'post');
     $this->setAttrib('action', '/error');
     /**
      * Agent Subform
      */
     $agent = new Zend_Form_SubForm();
     $agent->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_agent.phtml'))));
     // Business Name Element
     $agent->addElement('text', 'agent_business', array('filters' => array('StringTrim'), 'label' => 'Business Name:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // First Name Element
     $agent->addElement('text', 'agent_fname', array('filters' => array('StringTrim'), 'label' => 'First Name:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Last Name Element
     $agent->addElement('text', 'agent_lname', array('filters' => array('StringTrim'), 'label' => 'Last Name:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address1 Element
     $agent->addElement('text', 'agent_address1', array('filters' => array('StringTrim'), 'label' => 'Address1:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address2 Element
     $agent->addElement('text', 'agent_address2', array('filters' => array('StringTrim'), 'label' => 'Address2:', 'required' => false, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // City Element
     $agent->addElement('text', 'agent_city', array('filters' => array('StringTrim'), 'label' => 'City:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // State Element
     $agent->addElement('text', 'agent_state', array('filters' => array('StringTrim'), 'label' => 'State:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(new FFR_Form_Validator_ValidUnitedStates(), array('NotEmpty', true), array('StringLength', true, array(1, 50)))));
     // Zipcode Element
     $agent->addElement('text', 'agent_zip', array('filters' => array('StringTrim'), 'label' => 'Zipcode:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(new FFR_Form_Validator_ValidZipCode(), array('NotEmpty', true), array('StringLength', true, array(1, 10)))));
     // Work Phone Element
     $agent->addElement('text', 'agent_workphone', array('filters' => array('StringTrim'), 'label' => 'Work Phone:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Cell Phone Element
     $agent->addElement('text', 'agent_cellphone', array('filters' => array('StringTrim'), 'label' => 'Cell Phone:', 'required' => false, 'belongsTo' => 'agent', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Fax Element
     $agent->addElement('text', 'agent_fax', array('filters' => array('StringTrim'), 'label' => 'Fax:', 'required' => false, 'belongsTo' => 'agent', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Email Element
     $agent->addElement('text', 'agent_email', array('filters' => array('StringTrim', 'StringToLower'), 'label' => 'Email:', 'required' => true, 'belongsTo' => 'agent', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)), array('EmailAddress'))));
     /**
      * User Subform
      */
     $user = new Zend_Form_SubForm();
     $user->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_user.phtml'))));
     // Username Element
     $user->addElement('text', 'user_username', array('filters' => array('StringTrim', 'StringToLower'), 'label' => 'Username:', 'required' => true, 'belongsTo' => 'user', 'validators' => array(array('NotEmpty', true), 'Alnum', array('Regex', false, array('/^[a-z][a-z0-9]{3,20}$/')), array('Db_NoRecordExists', true, array('table' => 'user', 'field' => 'user_username')))));
     $user->getElement('user_username')->getValidator('Db_NoRecordExists')->setMessages(array('recordFound' => 'That username is already taken.  Please choose another.'));
     // Password Element
     $user->addElement('password', 'user_password', array('filters' => array('StringTrim'), 'label' => 'Password:', 'required' => true, 'belongsTo' => 'user', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(6)))));
     // Password Verify Element
     $user->addElement('password', 'password_confirm', array('filters' => array('StringTrim'), 'label' => 'Confirm Password:', 'required' => true, 'belongsTo' => 'user', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(6)))));
     // User Active Element
     $user->addElement('hidden', 'user_active', array('belongsTo' => 'user', 'required' => true, 'value' => '0'));
     $user->addElement('hidden', 'user_perms', array('belongsTo' => 'user', 'required' => true, 'value' => 'a:2:{s:5:"roles";a:1:{i:0;s:5:"Agent";}s:13:"acl_resources";a:0:{}}'));
     /**
      * Account Subform
      */
     $account = new Zend_Form_SubForm();
     $account->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_account.phtml'))));
     // Business Name Element
     $account->addElement('text', 'account_business', array('filters' => array('StringTrim'), 'label' => 'Business Name:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // First Name Element
     $account->addElement('text', 'account_fname', array('filters' => array('StringTrim'), 'label' => 'First Name:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Last Name Element
     $account->addElement('text', 'account_lname', array('filters' => array('StringTrim'), 'label' => 'Last Name:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address1 Element
     $account->addElement('text', 'account_address1', array('filters' => array('StringTrim'), 'label' => 'Address1:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // Address2 Element
     $account->addElement('text', 'account_address2', array('filters' => array('StringTrim'), 'label' => 'Address2:', 'required' => false, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // City Element
     $account->addElement('text', 'account_city', array('filters' => array('StringTrim'), 'label' => 'City:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)))));
     // State Element
     $account->addElement('text', 'account_state', array('filters' => array('StringTrim'), 'label' => 'State:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(new FFR_Form_Validator_ValidUnitedStates(), array('NotEmpty', true), array('StringLength', true, array(1, 50)))));
     // Zipcode Element
     $account->addElement('text', 'account_zip', array('filters' => array('StringTrim'), 'label' => 'Zipcode:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(new FFR_Form_Validator_ValidZipCode(), array('NotEmpty', true), array('StringLength', true, array(1, 10)))));
     // Work Phone Element
     $account->addElement('text', 'account_workphone', array('filters' => array('StringTrim'), 'label' => 'Work Phone:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Cell Phone Element
     $account->addElement('text', 'account_cellphone', array('filters' => array('StringTrim'), 'label' => 'Cell Phone:', 'required' => false, 'belongsTo' => 'account', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Fax Element
     $account->addElement('text', 'account_fax', array('filters' => array('StringTrim'), 'label' => 'Fax:', 'required' => false, 'belongsTo' => 'account', 'validators' => array(new FFR_Form_Validator_ValidPhone(), array('NotEmpty', true), array('StringLength', true, array(1, 15)))));
     // Email Element
     $account->addElement('text', 'account_email', array('filters' => array('StringTrim', 'StringToLower'), 'label' => 'Email:', 'required' => true, 'belongsTo' => 'account', 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 150)), array('EmailAddress'))));
     /**
      * Attach sub forms to main form
      */
     $this->addSubForms(array('agent' => $agent, 'user' => $user, 'account' => $account));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => 'Save & Continue', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
开发者ID:rantoine,项目名称:AdvisorIllustrator,代码行数:91,代码来源:Register.php


注:本文中的Zend_Form_SubForm::setDecorators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。