Наследование: extends Cake\View\Helper\FormHelper, use trait BootstrapTrait
Пример #1
0
 public function input($fieldName, array $options = [])
 {
     $options = $this->_parseOptions($fieldName, $options);
     $div = $this->_extractOption('div', $options, '');
     if ($div) {
         $_div = '';
         if (!isset($div['class'])) {
             $div['class'] = '';
         }
         $div['class'] = 'form-group {{type}}{{required}} ' . $div['class'];
         foreach ($div as $key => $value) {
             $_div .= $key . '="' . $value . '"';
         }
         $this->templates(['inputContainer' => '<div ' . $_div . '>{{content}}</div>']);
         unset($_div);
     }
     $options['title'] = $fieldName;
     if (isset($options['label']) and $options['label'] != false) {
         $options['title'] = $options['label'];
     } else {
         if (isset($options['placeholder']) and $options['placeholder'] != false) {
             $options['title'] = $options['placeholder'];
         }
     }
     $this->mergeClassCss([], $options);
     /* if($options['type'] == 'radio' OR $options['type'] == 'checkbox'){
               $input =    parent::input($fieldName, $options);
     
               } */
     return parent::input($fieldName, $options);
 }