...... <?=
ModalCreateUserForm::widget([
'model' => $model,
'userRole' => "Администратор"
]);
?>.....
Виджит во вьюхе
....
$form = ActiveForm::begin(['options' => ['class' => 'panel-body'],
'id' => 'createUserForm',
'enableAjaxValidation' => true,
'enableClientValidation' => true,
'validationUrl' => Url::to(['create-user-admin'])
]);
// $form = ActiveForm::begin([
// 'action' => Url::to(['users']),
// 'options' => ['class' => 'panel-body' ] ,
// 'id' => 'createUserForm',
// 'method' => 'POST',
// 'ajaxDataType' => 'x-www-form-urlencoded',
// 'enableAjaxValidation' => true]);
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'login')->input('login')
->label('Логин');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'fullName')->input('login')
->label('Ф.И.О.');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'email')->input('email')->label('E-mail');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'password')->passwordInput()->label('Пароль');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'form-group']);
echo $form->field($this->model, 'confirmPassword')->passwordInput()->label('Подтваердить пароль');
echo Html::endTag('div');
echo Html::beginTag('div', $options = ['class' => 'modal-footer']);
echo Html::a($text = 'Close', $url = "#", $options = [
'class' => 'btn btn-white',
'data-dismiss' => 'modal'
]);
echo Html::submitButton('Создать', ['class' => 'btn btn-primary']);
ActiveForm::end();....
Сам кусок виджета