Exemplo n.º 1
0
 /**
  * @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();
 }
Exemplo n.º 2
0
 /**
  * @param FormModel $FormModel
  */
 public function applyAllErrors(FormModel $FormModel)
 {
     $this->applyErrors($FormModel->getErrors());
 }