/** * @inheritdoc */ public function init() { if ($this->model instanceof \cookyii\base\FormModel) { $this->name = empty($this->name) ? $this->model->getClass() : $this->name; $this->action = empty($this->action) ? $this->model->formAction() : $this->action; } if (!isset($this->options['id'])) { $this->options['id'] = $this->name; } if (!isset($this->options['ng-submit'])) { $this->options['ng-submit'] = sprintf('submit(%s, $event)', $this->name); } if (!empty($this->controller)) { $this->options['ng-controller'] = $this->controller; } if (!isset($this->options['name'])) { $this->options['name'] = $this->name; } if (!isset($this->options['novalidate'])) { $this->options['novalidate'] = true; } parent::init(); }
/** * @param FormModel $FormModel */ public function applyAllErrors(FormModel $FormModel) { $this->applyErrors($FormModel->getErrors()); }