Bootstrap\View\Helper\BootstrapTrait::_addButtonClasses PHP Метод

_addButtonClasses() защищенный Метод

Add classes to options according to values of bootstrap-type and bootstrap-size for button.
protected _addButtonClasses ( $options ) : The
$options The initial options with bootstrap-type and/or bootstrat-size values
Результат The new options with class values (btn, and btn-* according to initial options)
    protected function _addButtonClasses($options)
    {
        $options += ['bootstrap-type' => $this->config('buttons.type'), 'bootstrap-size' => false];
        $type = $options['bootstrap-type'];
        $size = $options['bootstrap-size'];
        unset($options['bootstrap-type'], $options['bootstrap-size']);
        $options = $this->addClass($options, 'btn');
        if (!preg_match('#btn-[a-z]+#', $options['class'])) {
            $options = $this->addClass($options, 'btn-' . $type);
        }
        if ($size) {
            $options = $this->addClass($options, 'btn-' . $size);
        }
        return $options;
    }