/** * 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; }); }
/** * Set the attribute abbreviation options i.e.: * ['ph' => 'placeholder', 'req' => 'required'] * * You can set these values in the config file * * @param array $abbreviations * @static */ public static function setAbbreviations($abbreviations) { return \Styde\Html\FieldBuilder::setAbbreviations($abbreviations); }