示例#1
0
文件: Form.php 项目: siad007/ctrllib
 /**
  * @param array|\Traversable|ElementInterface $elementOrFieldset
  * @param array $flags
  * @return void|\Zend\Form\Fieldset|\Zend\Form\FieldsetInterface|\Zend\Form\FormInterface
  */
 public function add($elementOrFieldset, array $flags = array())
 {
     if ($elementOrFieldset instanceof ElementInterface) {
         $elementOrFieldset->setForm($this);
     }
     parent::add($elementOrFieldset, $flags);
 }
示例#2
0
 protected function isRequired(CtrlElement $element)
 {
     if ($element instanceof \Ctrl\Form\Element\ElementInterface && $element->getForm()->getInputFilter() && $element->getForm()->getInputFilter()->has($element->getName()) && $element->getForm()->getInputFilter()->get($element->getName())->isRequired()) {
         return true;
     }
     return false;
 }