Example #1
0
<?php

// Widgets
return ['activeForm' => ['class' => \rock\widgets\ActiveForm::className()], 'activeField' => ['class' => \rock\widgets\ActiveField::className()], 'widget\\captcha' => ['class' => \rock\widgets\Captcha::className()]];
Example #2
0
 /**
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     $this->csrf = Instance::ensure($this->csrf, '\\rock\\csrf\\CSRF', [], false);
     $this->request = Instance::ensure($this->request, '\\rock\\request\\Request');
     if (!empty($this->clientAction)) {
         $this->clientAction = Alias::getAlias($this->clientAction);
     }
     if (!isset($this->options['id'])) {
         $this->options['id'] = $this->getId();
     }
     if (!isset($this->fieldConfig['class'])) {
         $this->fieldConfig['class'] = ActiveField::className();
         $this->fieldConfig['enableClientValidation'] = $this->enableClientValidation;
         $this->fieldConfig['validateOnChanged'] = $this->validateOnChanged;
     }
     $this->modelName = $this->model->formName();
     $this->options = $this->clientOptions($this->options);
     echo ActiveHtml::beginForm($this->action, $this->method, $this->modelName, $this->options);
 }