Exemplo n.º 1
0
 /**
  * Register the Field Builder instance
  */
 protected function registerFieldBuilder()
 {
     $this->app->bind('field', function ($app) {
         $this->loadConfigurationOptions();
         $fieldBuilder = new FieldBuilder($app['form'], $this->theme, $app['translator']);
         if ($this->options['control_access']) {
             $fieldBuilder->setAccessHandler($app[AccessHandler::class]);
         }
         $fieldBuilder->setAbbreviations($this->options['abbreviations']);
         if (isset($this->options['theme_values']['field_classes'])) {
             $fieldBuilder->setCssClasses($this->options['theme_values']['field_classes']);
         }
         if (isset($this->options['theme_values']['field_templates'])) {
             $fieldBuilder->setTemplates($this->options['theme_values']['field_templates']);
         }
         if ($app['session.store']->has('errors')) {
             $fieldBuilder->setErrors($app['session.store']->get('errors')->toArray());
         }
         return $fieldBuilder;
     });
 }
Exemplo n.º 2
0
 /**
  * Set the default CSS classes for each input type.
  * 
  * You can set these values in the config file.
  *
  * @param array $cssClasses
  * @static 
  */
 public static function setCssClasses($cssClasses)
 {
     return \Styde\Html\FieldBuilder::setCssClasses($cssClasses);
 }