protected function compute_options(array &$field_options) { foreach ($field_options as $attribute => $value) { $attribute = strtolower($attribute); switch ($attribute) { case 'width': $this->width = $value; unset($field_options['width']); break; } } parent::compute_options($field_options); }
protected function compute_options(array &$field_options) { foreach ($field_options as $attribute => $value) { $attribute = strtolower($attribute); switch ($attribute) { case 'formatter': if ($value instanceof ContentFormattingExtensionPoint) { $this->formatter = $value; unset($field_options['formatter']); } else { throw new FormBuilderException('The value associated to the formatter attribute must be an instance of the ContentFormattingFactory class'); } break; } } parent::compute_options($field_options); }