예제 #1
0
 /**
  * Form Widget Name Modifiers
  * Add a number dimension to the form name
  * Compatible with widget preview prototype (__i__)
  * 
  * @return string
  */
 public function getNameIdentifier()
 {
     $name = parent::getNameIdentifier();
     if ($this->getFormType()->getType() == 'widget') {
         $name = preg_replace('/-(\\d|__i__)/', '[$1]', $name);
     }
     return $name;
 }
예제 #2
0
 /**
  * Get the form name identifier
  * 
  * @return string
  */
 public function getNameIdentifier()
 {
     $identifier = parent::getNameIdentifier();
     if ($this->isMultiple()) {
         $identifier .= '[]';
     }
     return $identifier;
 }
예제 #3
0
 /**
  * Add a children Form
  * 
  * @param string $key
  * @param \PopCode\Framework\Form\Form $form
  * @return \PopCode\Framework\Form\Form
  */
 public function add($key, \PopCode\Framework\Form\Form $form)
 {
     //set the name and id related to parent
     $form->setName($this->getId() . '[' . $form->getId() . ']');
     $form->setParent($this);
     $this->children[$key] = $form;
     return $this;
 }