Lines Matching defs:options
7 protected $options = [];
12 * @param array $options The available options
14 public function __construct($label, $options)
17 $this->options($options);
26 * @return string[] the values that have been set (options exist)
33 if (isset($this->options[$value])) {
42 * Get or set the options of the optgroup
54 * @param null|array $options
57 public function options($options = null)
59 if ($options === null) return $this->options;
60 if (!is_array($options)) throw new \InvalidArgumentException('Options have to be an array');
61 $this->options = [];
62 foreach ($options as $key => $val) {
78 $this->options[$key] = $val;
80 $this->options[$val] = ['label' => (string)$val];
82 $this->options[$key] = ['label' => (string)$val];
110 foreach ($this->options as $key => $val) {