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
 /**
  * Returns true if the $accessHandler is not set, otherwise it relies on the
  * handler implementation to check if the user should has access or not.
  *
  * @param array $options
  * @return bool 
  * @static 
  */
 public static function checkAccess($options)
 {
     return \Styde\Html\FieldBuilder::checkAccess($options);
 }