Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     switch ($options['widget']) {
         case 'single_text':
         case 'text':
         case 'choice':
             break;
         default:
             $view->vars['attr']['data-format'] = $this->getPattern($options['format']);
             $view->vars['javascript'] = $options['javascript'];
             if (isset($options['widget']) && $this->assetsLoader) {
                 switch ($options['widget']) {
                     case 'jqueryui':
                         $components = ['datepicker'];
                         break;
                     default:
                         $components = [];
                         break;
                 }
                 $this->assetsLoader->addVendor($options['widget'], $components);
                 $this->assetsLoader->addVendor('twitter-cldr');
                 $this->assetsLoader->addVendor('bootstrapp-datetime');
             }
             break;
     }
     $view->vars['attr']['autocomplete'] = 'off';
     parent::finishView($view, $form, $options);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     switch ($options['widget']) {
         case 'select2':
             if ($this->assetsLoader) {
                 $this->assetsLoader->addVendor($options['widget']);
             }
             break;
         default:
             break;
     }
     parent::buildView($view, $form, $options);
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     $view->vars['enable'] = $form->getConfig()->getAttribute('enable');
     if ($form->getConfig()->getAttribute('enable')) {
         $view->vars['base_path'] = $form->getConfig()->getAttribute('base_path');
         $view->vars['config'] = json_encode($form->getConfig()->getAttribute('config'));
         $view->vars['plugins'] = $form->getConfig()->getAttribute('plugins');
     }
     parent::buildView($view, $form, $options);
     // Dynamically load CKEditor assets
     if ($this->assetsLoader) {
         $this->assetsLoader->addVendor('ckeditor');
     }
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     if (isset($options['widget']) && $this->assetsLoader) {
         $this->assetsLoader->addVendor($options['widget']);
     }
     $view->vars['defaultCountry'] = $this->getDefaultCountry();
     parent::buildView($view, $form, $options);
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     switch ($options['widget']) {
         case 'single_text':
         case 'text':
         case 'choice':
             break;
         default:
             if (isset($options['widget']) && $this->assetsLoader) {
                 switch ($options['widget']) {
                     case 'jqueryui':
                         $components = ['datepicker'];
                         break;
                     default:
                         $components = [];
                         break;
                 }
                 $this->assetsLoader->addVendor($options['widget'], $components);
             }
             break;
     }
     parent::buildView($view, $form, $options);
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     $this->assetsLoader->addVendor('fileinput');
     parent::finishView($view, $form, $options);
 }