/**
  * Build the field configuration array
  * @return array Field configuration array
  */
 public function build()
 {
     return array_merge(['choices' => $this->getChoices()], parent::build());
 }
Example #2
0
 /**
  * Initialize the FieldBuilder, add to FieldManager
  * @param  FieldBuilder $field
  * @return FieldBuilder
  */
 protected function initializeField($field)
 {
     $field->setParentContext($this);
     $this->getFieldManager()->pushField($field);
     return $field;
 }
Example #3
0
 /**
  * @param string $name Field Name, conventionally 'snake_case'.
  * @param string $type Field Type.
  * @param array $config Additional Field Configuration.
  */
 public function __construct($name, $type = 'tab', $config = [])
 {
     $config = array_merge(['label' => $this->generateLabel($name)], $config);
     $name = $this->generateName($name) . '_tab';
     parent::__construct($name, $type, $config);
 }