Beispiel #1
0
 public function render(Form $form, $errors)
 {
     $fields = [];
     // sort fields by 'position'
     sort_children($form->fields);
     foreach ($form->fields as $field => $data) {
         $fields[] = $this->renderer->render($field, $data, $errors->get($field));
     }
     return view($form->template ?: $this->template)->with('options', $form->options)->with('fields', $fields)->render();
 }
Beispiel #2
0
 function sort_children(&$album)
 {
     if (isset($album['children']) && $album['count']) {
         foreach ($album['children'] as &$child) {
             sort_children($child);
         }
         TreeSorter::sort($album['children'], $album['sort']);
     }
 }