Creates default wrapper classes for the form element.

@param array $options
@return array
438131
protected function setDefaultClasses(array $options = [])
    {
        $defaults = parent::setDefaultClasses($options);
        $choice_type = $this->determineChoiceField();

        $wrapper_class = $this->formHelper->getConfig('defaults.' . $this->type . '.' . $choice_type . '_wrapper_class', '');
        if ($wrapper_class) {
            $defaults['wrapper']['class'] = (isset($defaults['wrapper']['class']) ? $defaults['wrapper']['class'] . ' ' : '') . $wrapper_class;
        }

        $choice_wrapper_class = $this->formHelper->getConfig('defaults.' . $this->type . '.choice_options.wrapper_class', '');
        $choice_label_class = $this->formHelper->getConfig('defaults.' . $this->type . '.choice_options.label_class', '');
        $choice_field_class = $this->formHelper->getConfig('defaults.' . $this->type . '.choice_options.field_class', '');

        if ($choice_wrapper_class) {
            $defaults['choice_options']['wrapper']['class'] = $choice_wrapper_class;
        }
        if ($choice_label_class) {
            $defaults['choice_options']['label_attr']['class'] = $choice_label_class;
        }
        if ($choice_field_class) {
            $defaults['choice_options']['attr']['class'] = $choice_field_class;
        }

        return $defaults;
    }
1309441
protected function _getBtnClass(array $options = [])
    {
        if (Arr::key('button', $options)) {
            $button = $options['button'];
            unset($options['button']);

            if (is_callable($this->getConfig('prepareBtnClass'))) {
                return (array) call_user_func($this->getConfig('prepareBtnClass'), $this, $options, $button);
            }

            $options = $this->_setBtnClass($button, $options);
        }

        return $options;
    }
329698
protected function normalizeOptions(array $options)
    {
        return array_merge(parent::normalizeOptions($options), [
            'inverse'   => $this->inverse,
            'fixed'     => $this->fixed,
            'static'    => $this->static,
            'brand'     => $this->brand,
            'useForm'   => $this->useForm,
            'rightMenu' => $this->rightMenu,
            ], $options);
    }
857331
protected function configureOptions(array $options)
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'adapter'          => null,
            'secure'           => true,
            'host'             => self::TMDB_URI,
            'base_url'         => null,
            'token'            => null,
            'session_token'    => null,
            'event_dispatcher' => array_key_exists('event_dispatcher', $this->options) ? $this->options['event_dispatcher'] : new EventDispatcher(),
            'cache'            => [],
            'log'              => [],
        ]);

        $resolver->setRequired([
            'adapter',
            'host',
            'token',
            'secure',
            'event_dispatcher',
            'cache',
            'log'
        ]);

        $resolver->setAllowedTypes('adapter', ['object', 'null']);
        $resolver->setAllowedTypes('host', ['string']);
        $resolver->setAllowedTypes('secure', ['bool']);
        $resolver->setAllowedTypes('token', ['object']);
        $resolver->setAllowedTypes('session_token', ['object', 'null']);
        $resolver->setAllowedTypes('event_dispatcher', ['object']);

        $this->options = $resolver->resolve($options);

        $this->postResolve($options);

        return $this->options;
    }
1310559
private function resolveOptions(array $options)
    {
        if (!$this->optionsResolver) {
            $this->optionsResolver = new OptionsResolver();

            $this->optionsResolver->setDefaults([
                'validation_groups' => null,
                'constraints' => null,
                'constraints_extra' => null
            ]);
        }

        return $this->optionsResolver->resolve($options);
    }
344016
protected function _transformCrudOptions(array $options) {
		if (isset($options['params']['class']) && !isset($options['type'])) {
			$class = $options['params']['class'];
			$pos = strrpos($class, ' ');
			if ($pos !== false) {
				$class = substr($class, $pos + 1);
			}
			$options['type'] = $class;
			$options['element'] = $class;
			unset($options['params']['class']);
			unset($options['params']['original']);
		}

		return $options;
	}
222988
public function chosen($fieldName, $options = [])
    {
        $defaults = [
            'div' => [
                'class' => 'form-group',
            ],
            'class' => 'form-control form-control-chosen',
            'empty' => true,
        ];

        if (isset($options['class'])) {
            $defaults = parent::addClass($defaults, $options['class']);
            unset($options['class']);
        }
        $options = array_merge($defaults, $options);
        return parent::input($fieldName, $options);
    }
935273
private function getDefaultHttpClientOptions(array $options = []): array
    {
        $headers = [];

        if ($this->token !== null) {
            $headers['Authorization'] = 'Bearer '.$this->token;
        }

        $languagesInOptions = (array_key_exists('headers', $options) &&
            array_key_exists('Accept-Language', $options['headers']));
        if ($this->languages !== null && $languagesInOptions === false) {
            $headers['Accept-Language'] = join(', ', $this->languages);
        }

        if ($this->version !== null) {
            $headers['Accept'] = 'application/vnd.thetvdb.v'.$this->version;
        }

        $options['http_errors'] = false;

        return array_merge_recursive(['headers' => $headers], $options);
    }
527839
public function tags ($options = [])
		{
			$options[ 'data-role' ] = 'tagsinput';

			$this->adjustLabelFor($options);
			if (!isset($options[ 'id' ]))
				$options[ 'id' ] = $this->getInputId();

			$model = $this->model;
			$attribute = $this->attribute;
			$data = $model->$attribute;
			$value = '';
			if (is_array($data))
			{
				if (count($data) > 0)
				{
					if (is_object($data[ 0 ]))
						$value = implode(',', ArrayHelper::objectsAttribute($data, 'title'));
					else
						$value = implode(',', $data);
				}
			}
			else
				$value = $data;

			$this->parts[ '{input}' ] = Html::textInput(Html::getInputName($model, $attribute), $value, $options);

			return $this;
		}
299307
public function prepare($options = [])
    {
        if (request()->ajax()) {
            return $this->getArray($options);
        }

        return $this->getHtml($options);
    }
1264288
protected function setOptions($options = [])
    {
        $myProperties = get_class_vars(__CLASS__);
        $myDefaults = $myProperties['DEFAULTS'];
        $defaults = array_replace_recursive($myDefaults, $this->DEFAULTS);

        if (empty($this->rootPath)) {
            $this->rootPath = realpath($this->getChildDir()) . '/';
        }

        $defaults['description']['jsonPath'] = realpath($this->rootPath . $this->DEFAULT_API_JSON_PATH);
        $mergedOptions = array_replace_recursive($defaults, $options);
        $parsedOptions = $this->parseOptions($mergedOptions, $mergedOptions);

        $handlers = $this->getStacks($parsedOptions);
        if (!empty($handlers)) {
            if (empty($parsedOptions['client'])) {
                $parsedOptions['client'] = [];
            }
            $parsedOptions['client']['handler'] = $handlers;
        }

        $this->options = $parsedOptions;

        return $this;
    }
36670
public function setOptions(array $options)
    {
        if (isset($options['label'])) {
            $this->setLabel($options['label']);
        }

        if ($this instanceof FormElementInterface) {
            if (isset($options['defaultValue'])) {
                $this->setDefaultValue($options['defaultValue']);
            }

            if (isset($options['properties'])) {
                foreach ($options['properties'] as $key => $value) {
                    $this->setProperty($key, $value);
                }
            }
        }

        if (isset($options['rendererClassName'])) {
            $this->setRendererClassName($options['rendererClassName']);
        }

        if (isset($options['renderingOptions'])) {
            foreach ($options['renderingOptions'] as $key => $value) {
                $this->setRenderingOption($key, $value);
            }
        }

        if (isset($options['validators'])) {
            foreach ($options['validators'] as $validatorConfiguration) {
                $this->createValidator($validatorConfiguration['identifier'], isset($validatorConfiguration['options']) ? $validatorConfiguration['options'] : []);
            }
        }

        FormArrays::assertAllArrayKeysAreValid($options, array('label', 'defaultValue', 'properties', 'rendererClassName', 'renderingOptions', 'validators'));
    }
1369011
protected function parseOptions(array $options): array
    {
        // Set a default "id" attribute. This attribute can be used on the field
        // and to its associated label as the "for" attribute value if not set.
        if (! isset($options['attributes']['id'])) {
            $options['attributes']['id'] = $this->getName().'_field';
        }

        // Set the "for" attribute automatically on the label attributes property.
        if (! isset($options['label_attr']['for'])) {
            $options['label_attr']['for'] = $options['attributes']['id'];
        }

        // Set some default CSS classes if chosen theme is "bootstrap".
        if (isset($options['theme']) && 'bootstrap' === $options['theme']) {
            if (isset($options['attributes']['class'])) {
                $options['attributes']['class'] .= ' form-control';
            } else {
                $options['attributes']['class'] = 'form-control';
            }
        }

        // Set default value if defined.
        if (isset($options['data']) && ! is_null($options['data'])) {
            $this->setValue($options['data']);
        }

        return $options;
    }
852758
protected function processOptions(array $options)
    {
        $resolver = new OptionsResolver();
        $this->setDefaultOptions($resolver);

        return $resolver->resolve($options);
    }
933746
private function getReflectionClass(array $options)
    {
        $className = isset($options['className']) ? $options['className'] : 'TCPDF';

        if (!isset($this->reflClassCache[$className])) {
            $this->reflClassCache[$className] = new \ReflectionClass($className);
        }

        return $this->reflClassCache[$className];
    }
1264459
protected function createForm($options = null)
    {
        $form = parent::createForm($options);

        $form->activateJQuery();

        return $form;
    }
29874
public function render(array $options = [])
    {
        $attrs['id'] = $this->getAttribute('controlId', $this->getId() . '-control');
        $attrs['class'] = $this->type . '-field ' . $this->getAttribute('controlClass');

        $attrs = array_merge($attrs, (array) $this->getAttribute('controlAttribs'));

        if ($this->form && $this->form->getRenderer()) {
            return $this->wrapElements($this->form->getRenderer()->renderField($this, $attrs, $options));
        }

        $label = !empty($options['no_label']) ? '' : $this->renderLabel($options);
        $input = $this->renderInput($options);

        return $this->wrapElements(new HtmlElement('div', $label . $input, $attrs));
    }