示例#1
0
文件: Form.php 项目: rudott/symfony
 /**
  * Adds a child to the form.
  *
  * @param FormInterface $child The FormInterface to add as a child
  *
  * @return Form the current form
  */
 public function add(FormInterface $child)
 {
     $this->children[$child->getName()] = $child;
     $child->setParent($this);
     if ($this->dataMapper) {
         $this->dataMapper->mapDataToForm($this->getClientData(), $child);
     }
     return $this;
 }
示例#2
0
文件: Form.php 项目: nicodmf/symfony
 /**
  * Adds a child to the form.
  *
  * @param FormInterface $child The FormInterface to add as a child
  *
  * @return Form the current form
  */
 public function add(FormInterface $child)
 {
     if ($this->bound) {
         throw new AlreadyBoundException('You cannot add children to a bound form');
     }
     $this->children[$child->getName()] = $child;
     $child->setParent($this);
     if ($this->dataMapper) {
         $this->dataMapper->mapDataToForm($this->getClientData(), $child);
     }
     return $this;
 }