Example #1
0
 /**
  * @param Field $field
  * @param array $section
  */
 protected function buildField(Field $field, array $section)
 {
     foreach ($section as $key => $data) {
         if (substr($key, 0, 1) == '@' || $key == 'name') {
             continue;
         }
         if ($key == 'value') {
             $field->setValue($data);
         } elseif ($key == 'label') {
             $field->setLabel($data);
         } elseif ($key == 'multiple') {
             $field->setMultiple($data);
         } elseif ($key == 'filters') {
             $field->setFilters($data);
         } elseif ($key == 'options') {
             $field->setOptions($data);
         } elseif ($key == 'attributes') {
             $field->setAttributes($data);
         } elseif (static::isBaseAttribute($key)) {
             $field->setAttribute($key, $data);
         }
     }
 }