Пример #1
0
<?php

use yii\helpers\Html;
use yii\bootstrap\Tabs;
use app\widgets\ActiveForm;
use app\widgets\ButtonsContatiner;
use app\widgets\Modal;
if ($model->isNewRecord) {
    $obj_id = 'user-role_create';
    $header = __('Create user role');
} else {
    $obj_id = 'user-role_' . $model->name;
    $header = __('User role: {role}', ['role' => $model->description]);
}
$form_id = $obj_id . '_form';
Modal::begin(['size' => Modal::SIZE_LARGE, 'header' => $header, 'id' => $obj_id, 'footer' => ButtonsContatiner::widget(['model' => $model, 'footerWrapper' => false, 'removeLink' => false, 'form' => $form_id])]);
$form = ActiveForm::begin(['options' => ['id' => $form_id]]);
echo Tabs::widget(['options' => ['id' => $form_id . '_tabs', 'class' => 'app-tabs-save'], 'items' => [['label' => __('General'), 'content' => $this->render('components/form_general', ['form' => $form, 'model' => $model])], ['label' => __('Permissions'), 'content' => $this->render('components/form_permissions', ['form' => $form, 'model' => $model])], ['label' => __('Inherited roles'), 'content' => $this->render('components/form_inherit', ['form' => $form, 'model' => $model])]]]);
ActiveForm::end();
Modal::end();
Пример #2
0
<?php

use app\widgets\ActiveForm;
use app\widgets\ButtonsContatiner;
use app\widgets\Modal;
use app\models\User;
if ($model->isNewRecord) {
    $obj_id = 'donate_create';
    $header = __('Create donate');
} else {
    $obj_id = 'donate_' . $model->id;
    $header = __('Donate: {donate}', ['donate' => $model->id]);
}
$form_id = $obj_id . '_form';
Modal::begin(['size' => Modal::SIZE_LARGE, 'header' => $header, 'id' => $obj_id, 'footer' => ButtonsContatiner::widget(['model' => $model, 'footerWrapper' => false, 'removeLink' => false, 'saveLink' => Yii::$app->user->can('donate_manage'), 'form' => $form_id])]);
$form = ActiveForm::begin(['options' => ['id' => $form_id]]);
echo $form->field($model, 'partner_id')->widget('app\\widgets\\SelectAjax', ['initValueText' => $model->partner ? $model->partner->extendedName : '', 'url' => !$model->isNewRecord ? ['partner/update', 'id' => $model->partner_id] : false]);
echo $form->field($model, 'user_id')->dropDownList(User::find()->scroll(['empty' => true]), ['class' => 'form-control app-select2']);
echo $form->field($model, 'sum')->textInput(['maxlength' => 19]);
echo $form->field($model, 'timestamp')->widget('app\\widgets\\DatePicker', ['options' => ['id' => $form_id . '-timestamp']]);
echo $form->field($model, 'notes')->textarea(['rows' => 6]);
if (!$model->isNewRecord) {
    echo $form->field($model, 'created_at')->widget('app\\widgets\\Text', ['formatter' => 'date']);
    echo $form->field($model, 'updated_at')->widget('app\\widgets\\Text', ['formatter' => 'date']);
}
ActiveForm::end();
Modal::end();
Пример #3
0
<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use app\widgets\ButtonsContatiner;
$form = ActiveForm::begin(['layout' => 'horizontal', 'fieldConfig' => ['template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}", 'horizontalCssClasses' => ['label' => 'col-sm-2', 'offset' => 'col-sm-offset-4', 'wrapper' => 'col-sm-10', 'error' => '', 'hint' => '']]]);
echo $form->field($model, 'username')->textInput(['maxlength' => 255]);
echo $form->field($model, 'email')->textInput(['maxlength' => 255]);
echo $form->field($model, 'password')->passwordInput();
echo $form->field($model, 'fullname')->textInput(['maxlength' => 255]);
echo ButtonsContatiner::widget(['model' => $model]);
ActiveForm::end();
Пример #4
0
<?php

use yii\bootstrap\ActiveForm;
use yii\bootstrap\Tabs;
use app\widgets\ButtonsContatiner;
$form = ActiveForm::begin(['options' => ['name' => 'options_form'], 'layout' => 'horizontal', 'fieldConfig' => ['template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}", 'horizontalCssClasses' => ['label' => 'col-sm-3', 'wrapper' => 'col-sm-9', 'error' => '', 'hint' => '']]]);
echo Tabs::widget(['items' => [['label' => __('General'), 'content' => $this->render('form_general', ['model' => $model, 'form' => $form]), 'active' => true], ['label' => __('Cart'), 'content' => $this->render('form_statistics', ['model' => $model, 'form' => $form, 'store' => $store])], ['label' => __('Payment'), 'content' => $this->render('form_payment', ['model' => $model, 'form' => $form, 'store' => $store])]]]);
if (empty($hide_buttons_container)) {
    echo ButtonsContatiner::widget(['model' => $model, 'removeLink' => false]);
}
ActiveForm::end();