예제 #1
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, $config = [])
 {
     if (array_key_exists('choices', $config)) {
         $this->setChoices($config['choices']);
         unset($config['choices']);
     }
     parent::__construct($name, $type, $config);
 }
예제 #2
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);
 }