コード例 #1
0
ファイル: Form.php プロジェクト: jeremykendall/spaz-api
 /**
  * Initiallizes the Lupin Form Object. Sets the Lupin Composite decorator.
  * Remove default decorators from every element of the form.
  *
  * @return void
  */
 protected function prepare()
 {
     $this->setDisableLoadDefaultDecorators(true);
     $decorators = array(new Lupin_Form_Decorator_Composite());
     if ($this->_request->getParam('partial') !== 'true') {
         $options = array('placement' => 'prepend', 'markupListStart' => '<div class="form_errors">', 'markupListEnd' => '</div>', 'markupListItemStart' => '', 'markupListItemEnd' => '<br />', 'escape' => true);
         $errors = new Zend_Form_Decorator_FormErrors($options);
         $decorators[] = $errors;
     }
     $escape = new Zend_Form_Decorator_Description();
     $escape->setEscape(array('Lupin_Security', 'escape'));
     $decorators[] = $escape;
     $this->setDecorators($decorators);
     $this->setMethod($this->_method);
     $action = $this->getAction();
     if (empty($action)) {
         $this->setAction($this->_request->getPathInfo());
     }
     $id = $this->getId();
     if (empty($id)) {
         $this->setAttrib('id', $this->_request->getActionName());
     }
     // add a token check to all forms
     $this->addElement(new Zend_Form_Element_Hash('token', array('ignore' => true)));
 }
コード例 #2
0
ファイル: Divctr.php プロジェクト: DivanteLtd/Zendformbuilder
 public function buildDescription()
 {
     $dec = new Zend_Form_Decorator_Description(array('tag' => 'p', 'class' => 'description'));
     $dec->setElement($this->getElement());
     return $dec->render($content);
 }