Пример #1
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->registerResources();
     if (!isset($this->app['html'])) {
         $this->app->bindShared('html', function ($app) {
             return new \Collective\Html\HtmlBuilder($app['url']);
         });
     }
     $this->app->bindShared('laravalid', function ($app) {
         $plugin = \Config::get('laravalid.plugin');
         $converterClassName = 'Bllim\\Laravalid\\Converter\\' . $plugin . '\\Converter';
         $converter = new $converterClassName();
         $form = new FormBuilder($app->make('html'), $app->make('url'), $app->make('session.store')->getToken(), $converter);
         return $form->setSessionStore($app->make('session.store'));
     });
 }
Пример #2
0
 public function inputSet($type, $name, $value = null, $options = [], $customInput = null)
 {
     $options = $this->converter->convert(Helper::getFormAttribute($name)) + $options;
     $labelText = isset($options['label']) ? $options['label'] : null;
     $requiredLabel = isset($options['data-rule-required']) ? self::$requiredLabel : '';
     $label = self::label($name, $labelText, [], $requiredLabel);
     $input = isset($customInput) ? $customInput : parent::input($type, $name, $value, $options);
     return self::makeSet($label, $input);
 }