Symfony\Component\Form\Form::getChildren PHP Method

getChildren() public method

Returns all children in this group.
public getChildren ( ) : array
return array
    public function getChildren()
    {
        return $this->children;
    }

Usage Example

Example #1
0
 public static function getAllErrors(Form $form, $parent_prefix = '')
 {
     $id = $parent_prefix . ($parent_prefix ? '_' : '') . $form->getName();
     $errors = array($id . '_errors' => array());
     foreach ($form->getErrors() as $error) {
         $errors[$id . '_errors'][] = array('error' => self::formatErrors($error));
     }
     if (!count($errors[$id . '_errors'])) {
         unset($errors[$id . '_errors']);
     }
     foreach ($form->getChildren() as $child) {
         if ($_errors = self::getAllErrors($child, $id)) {
             $errors = array_merge($errors, $_errors);
         }
     }
     if (count($errors)) {
         return $errors;
     } else {
         return false;
     }
 }
All Usage Examples Of Symfony\Component\Form\Form::getChildren