예제 #1
0
 /**
  * Build Form::inputs structure
  *
  * @param ParameterRegistry $parameters Form parameters collection.
  * @param array $options Additional input options.
  * @return array
  */
 public function inputs(ParameterRegistry $parameters, $options = [])
 {
     $result = [];
     $entityName = Inflector::singularize($parameters->formName);
     foreach ($parameters->collection() as $primaryParameter) {
         foreach ($primaryParameter->viewValues() as $param) {
             $name = $param->config('name');
             $inputOptions = array_key_exists($name, $options) ? $options[$name] : [];
             $input = $this->input($param, $inputOptions);
             $field = $param->config('field');
             if (!empty($entityName)) {
                 $field = "{$entityName}.{$field}";
             }
             $result[$field] = $input;
         }
     }
     return $result;
 }
예제 #2
0
 /**
  * process param parsing
  *
  * @return void
  */
 protected function _process()
 {
     $name = $this->config('field');
     $this->value = $this->_registry->data($name);
     $this->_processed = true;
 }