Construct the widgets and binds the default context providers
public __construct ( Cake\View\View $View, array $config = [] ) | ||
$View | Cake\View\View | The View this helper is being attached to. |
$config | array | Configuration settings for the helper. |
/** * Construct the widgets and binds the default context providers. * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper. */ public function __construct(View $View, array $config = []) { $this->_defaultConfig['errorClass'] = null; $this->_defaultConfig['templates'] = array_merge($this->_defaultConfig['templates'], ['error' => '<div class="text-danger">{{content}}</div>', 'inputContainer' => '<div class="form-group">{{content}}</div>', 'inputContainerError' => '<div class="form-group has-error">{{content}}{{error}}</div>', 'checkboxWrapper' => '<div class="checkbox"><label>{{input}}{{label}}</label></div>', 'radioWrapper' => '<div class="radio"><label>{{input}}{{label}}</label></div>']); $this->_defaultWidgets = array_merge($this->_defaultWidgets, ['button' => 'BootstrapUI\\View\\Widget\\ButtonWidget']); parent::__construct($View, $config); }
/** * Form helper constructor. * * @param View $View * @param array $config */ public function __construct(View $View, array $config = []) { $this->config('templates.input', '{{before}}<input type="{{type}}" name="{{name}}"{{attrs}}/>{{after}}'); $this->config('templates.inputContainer', '<div class="input {{class}}{{type}}{{required}}">{{content}}</div>'); $this->config('templates.inputContainerError', '<div class="input {{class}}{{type}}{{required}} error">{{content}}{{error}}</div>'); parent::__construct($View, $config); }
/** * Construct the widgets and binds the default context providers * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper. */ public function __construct(View $View, array $config = []) { $this->_defaultConfig += $this->_defaultConfigExt; $defaultConfig = (array) Configure::read('FormConfig'); if ($defaultConfig) { $this->_defaultConfig = Hash::merge($this->_defaultConfig, $defaultConfig); } parent::__construct($View, $config); }
/** * Construct the widgets and binds the default context providers. * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper. */ public function __construct(View $View, array $config = []) { $this->_defaultConfig = ['align' => 'default', 'errorClass' => null, 'grid' => ['left' => 2, 'middle' => 6, 'right' => 4], 'templates' => $this->_templates + $this->_defaultConfig['templates']] + $this->_defaultConfig; if (isset($this->_defaultConfig['templateSet'])) { $this->_defaultConfig['templateSet'] = Hash::merge($this->_templateSet, $this->_defaultConfig['templateSet']); } else { $this->_defaultConfig['templateSet'] = $this->_templateSet; } $this->_defaultWidgets = $this->_widgets + $this->_defaultWidgets; parent::__construct($View, $config); }
public function __construct(\Cake\View\View $view, array $config = []) { if (isset($config['buttons'])) { if (isset($config['buttons']['type'])) { $this->defaultButtonType = $config['buttons']['type']; } } if (isset($config['columns'])) { $this->defaultColumnSize = $config['columns']; } parent::__construct($view, $config); }
public function __construct(\Cake\View\View $view, array $config = []) { if (isset($config['buttons'])) { if (isset($config['buttons']['type'])) { $this->defaultButtonType = $config['buttons']['type']; } } if (isset($config['columns'])) { $this->defaultColumnSize = $config['columns']; } $this->_defaultWidgets['radioNestingLabel'] = ['Bootstrap3\\View\\Widget\\RadioNestingLabelWidget']; $this->_defaultWidgets['radio'] = ['Cake\\View\\Widget\\RadioWidget', 'radioNestingLabel']; parent::__construct($view, $config); }
public function __construct(\Cake\View\View $view, array $config = []) { if (isset($config['buttons'])) { if (isset($config['buttons']['type'])) { $this->_defaultButtonType = $config['buttons']['type']; } } if (isset($config['columns'])) { $this->_defaultColumnSize = $config['columns']; } if (isset($config['useCustomFileInput'])) { $this->_customFileInput = $config['useCustomFileInput']; } $this->colSize = $this->_defaultColumnSize; $this->_defaultConfig['templateClass'] = 'Bootstrap\\View\\BootstrapStringTemplate'; parent::__construct($view, $config); }
/** * Construct the widgets and binds the default context providers. * * This method only rewrites the default templates config. * @param Cake\View\View $view The View this helper is being attached to * @param array $config Configuration settings for the helper * @return void * @uses $_defaultConfig */ public function __construct(View $view, $config = []) { //Rewrites default templates config $this->_defaultConfig = Hash::merge($this->_defaultConfig, ['templates' => ['checkboxContainer' => '<div class="input {{type}}{{required}}">{{content}}{{help}}</div>', 'nestingLabel' => '{{hidden}}<label{{attrs}}>{{input}} {{text}}</label>', 'inputContainer' => '<div class="form-group input {{type}}{{required}}">{{content}}{{help}}</div>', 'inputContainerError' => '<div class="form-group input {{type}}{{required}} has-error">{{content}}{{help}}{{error}}</div>']]); parent::__construct($view, $config); }
public function __construct(View $View, array $config = []) { $this->_defaultConfig['templates'] = array_merge($this->_defaultConfig['templates'], $this->templates); parent::__construct($View, $config); }
/** * Construct the widgets and binds the default context providers * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper. */ public function __construct(View $View, array $config = []) { parent::__construct($View, $config); $this->addWidget('color_picker', ['ColorPicker', '_view']); $this->addWidget('font_panel', ['FontPanel', '_view']); }
public function __construct(View $View, array $config = []) { parent::__construct($View, $config); }
public function __construct(View $view, $config = []) { parent::__construct($view, $config); }
/** * Construct the widgets and binds the default context providers. * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper. */ public function __construct(View $View, array $config = []) { $this->_defaultWidgets = $this->_widgets + $this->_defaultWidgets; parent::__construct($View, $config); }
/** * Form helper constructor. * * @param View $View * @param array $config */ public function __construct(View $View, array $config = []) { $this->config('templates.checkbox', '<label class="pos-rel"><input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}><span class="lbl"></span></label>'); parent::__construct($View, $config); }