Blame view

frontend/modules/forms/views/form/form.php 573 Bytes
c7f97c88   alex   Google recaptcha ...
1
2
3
4
5
6
7
8
9
  <?php
  /**
   * @var \yii\db\ActiveRecord $model
   * @var array $types
   */
  
  use yii\helpers\Html;
  use yii\widgets\ActiveForm;
  
94154eea   Alex Savenko   Добавление капчи ...
10
11
12
13
14
  $form = ActiveForm::begin([
  	'id' => 'dynamic-form',
  	'enableAjaxValidation'   => false,
  	'enableClientValidation' => true,
  ]);
c7f97c88   alex   Google recaptcha ...
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  foreach ($this->context->module->attributes as $field) {
  	if (isset($types[$field])) {
  		$function = $types[$field]['type'];
  		echo $form->field($model, $field)
  			->$function(
  				$types[$field]['options']
  			);
  	} else {
  		echo $form->field($model, $field);
  	}
  
  }
  
  echo Html::submitButton();
  
  $form = ActiveForm::end();