public function __construct(Container $app, $type, $name, $label, $value, $attributes) { // Set base parameters $this->app = $app; $this->type = $type; $this->value = $value; $this->setAttributes($attributes); $this->form = $this->app->bound('former.form') ? $this->app['former.form'] : null; // Compute and translate label $this->automaticLabels($name, $label); // Repopulate field if ($type != 'password' && $name !== '_token') { $this->value = $this->repopulate(); } // Apply Live validation rules if ($this->app['former']->getOption('live_validation')) { $rules = new LiveValidation($this); $rules->apply($this->getRules()); } // Bind the Group class $groupClass = $this->isCheckable() ? 'CheckableGroup' : 'Group'; $groupClass = Former::FORMSPACE . $groupClass; $this->group = new $groupClass($this->app, $this->label); }
/** * Build a new checkable */ public function __construct(Container $app, $type, $name, $label, $value, $attributes) { parent::__construct($app, $type, $name, $label, $value, $attributes); if (is_array($this->value)) { $this->items($this->value); } }