Example #1
0
<?php

use yii\helpers\Html;
use common\themes\admin\widgets\ActiveForm;
use yii\bootstrap\Tabs;
use common\modules\users\models\User;
use common\modules\filemanager\widgets\Image;
use andreosoft\summernote\Summernote;
?>

<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'boxTitle' => $options['title'], 'buttonUndo' => $options['buttonUndo']]]);
echo Tabs::widget(['options' => ['class' => 'nav-tabs-custom'], 'items' => [['label' => \Yii::t('users/main', 'Main'), 'content' => $form->field($model, 'username')->textInput(['maxlength' => 255]) . $form->field($model, 'email')->textInput(['maxlength' => 255]) . $form->field($model, 'status')->dropDownList(User::getStatusArray()) . $form->field($model, 'role')->dropDownList(User::getRoleArray()) . Html::a('Изменить пароль', ['new-password', 'id' => $model->id], ['class' => 'btn btn-primary'])], ['label' => \Yii::t('users/main', 'Profile'), 'content' => $form->field($modelProfile, 'fullname')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'phone')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'website')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'skype')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'image')->widget(Image::className())], ['label' => \Yii::t('users/main', 'Adress'), 'content' => $form->field($modelProfile, 'country')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'state')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'zip')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'city')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'address')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'geopoint_latitude')->textInput(['maxlength' => 255]) . $form->field($modelProfile, 'geopoint_longitude')->textInput(['maxlength' => 255])], ['label' => \Yii::t('users/main', 'About'), 'content' => $form->field($modelProfile, 'about')->widget(Summernote::className(), ['editorOptions' => ['height' => 200]])]]]);
?>

<?php 
ActiveForm::end();
?>

Example #2
0
echo $form->field($model, 'createdby')->textInput();
?>
    <?php 
echo $form->field($model, 'createdon')->textInput();
?>
    <?php 
echo $form->field($model, 'image')->widget(Image::className());
?>
    <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => 255]);
?>
    <?php 
echo $form->field($model, 'introtext')->widget(Summernote::className(), ['editorOptions' => ['height' => 200]]);
?>
    <?php 
echo $form->field($model, 'content')->widget(Summernote::className(), ['editorOptions' => ['height' => 400]]);
?>
    <?php 
echo $form->field($model, 'like')->textInput();
?>
    <?php 
echo $form->field($model, 'dislike')->textInput();
?>
    <?php 
echo $form->field($model, 'views')->textInput();
?>
    <?php 
echo $form->field($model, 'rate')->textInput();
?>
    <?php 
echo $form->field($model, 'rate_num')->textInput();
Example #3
0
use yii\helpers\Url;
use yii\helpers\Html;
use yii\bootstrap\Tabs;
use common\themes\admin\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\widgets\dataPicker\DatePicker;
use andreosoft\summernote\Summernote;
use common\modules\filemanager\widgets\Image;
use common\modules\content\models\backend\Content;
use yii\grid\CheckboxColumn;
use common\themes\admin\widgets\GridView;
use common\modules\comments\models\CommentsSearch;
use common\modules\gallery\widgets\Galleryinline;
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'boxTitle' => $options['title'], 'buttonUndo' => $options['buttonUndo']]]);
?>

<?php 
echo Tabs::widget(['options' => ['class' => 'nav-tabs-custom'], 'items' => [['label' => \Yii::t('content/main', 'Main'), 'content' => $form->field($model, 'name')->textInput(['maxlength' => 255]) . $form->field($model, 'introtext')->widget(Summernote::className(), ['editorOptions' => ['height' => 200]]) . $form->field($model, 'content')->widget(Summernote::className(), ['editorOptions' => ['height' => 400]]), 'active' => true], ['label' => \Yii::t('content/main', 'Info'), 'content' => $form->field($model, 'tag')->textInput(['maxlength' => 255]) . $form->field($model, 'image')->widget(Image::className())], ['label' => \Yii::t('content/main', 'Seo'), 'content' => $form->field($model, 'seo_url')->textInput(['maxlength' => 255]) . $form->field($model, 'seo_title')->textInput(['maxlength' => 255]) . $form->field($model, 'seo_description')->textarea() . $form->field($model, 'seo_keyword')->textInput(['maxlength' => 255])], ['label' => \Yii::t('content/main', 'Manager'), 'content' => $form->field($model, 'status')->dropDownList(Content::getStatusArray()) . $form->field($model, 'publishedondate')->widget(DatePicker::className()) . $form->field($model, 'publishedontime')->textInput() . $form->field($model, 'template')->textInput(['maxlength' => 255])], ['label' => 'Comments', 'content' => isset($model->id) ? \common\themes\admin\widgets\GridViewEdited::widget(['dataProvider' => (new CommentsSearch())->search(['CommentsSearch' => ['table_name' => 'content', 'table_id' => $model->id]]), 'actionUpdate' => Url::to(['/comments/backend/update']), 'createModel' => new \common\modules\comments\models\Comments(), 'defaultValue' => ['Comments[table_id]' => $model->id, 'Comments[table_name]' => 'content'], 'columns' => [['attribute' => 'status', 'value' => function ($model) {
    return Html::activeDropDownList($model, 'status', ['Unpublished', 'Published'], ['class' => 'form-control', 'style' => 'width:100%;', 'prompt' => 'Выберите']);
}], ['attribute' => 'content'], ['class' => \common\themes\admin\widgets\ActionColumn::className(), 'template' => '{delete}', 'controller' => '/comments/backend']]]) : '<div class="alert alert-warning alert-dismissable">' . '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' . '<h4><i class="icon fa fa-warning"></i> Внимение!</h4>' . \Yii::t('content/main', 'Save befor use it') . '</div>' . Html::submitButton('Save', ['class' => 'btn btn-success'])], ['label' => \Yii::t('content/main', 'Gallery'), 'content' => isset($model->id) ? \common\themes\admin\widgets\GridViewEdited::widget(['dataProvider' => (new \common\modules\gallery\models\GallerySearch())->search(['GallerySearch' => ['table_name' => $model->tableName(), 'table_id' => $model->id]]), 'actionUpdate' => Url::to(['/gallery/backend/update']), 'createModel' => new \common\modules\gallery\models\Gallery(), 'defaultValue' => ['Gallery[table_id]' => $model->id, 'Gallery[table_name]' => $model->tableName()], 'columns' => [['class' => common\modules\filemanager\widgets\ImageColumn::className(), 'attribute' => 'image'], ['attribute' => 'status', 'value' => function ($model) {
    return Html::activeDropDownList($model, 'status', ['Unpublished', 'Published'], ['class' => 'form-control', 'style' => 'width:100%;', 'prompt' => 'Выберите']);
}], 'content', ['class' => \common\themes\admin\widgets\ActionColumn::className(), 'template' => '{delete}', 'controller' => '/gallery/backend']]]) : '<div class="alert alert-warning alert-dismissable">' . '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' . '<h4><i class="icon fa fa-warning"></i> Внимение!</h4>' . \Yii::t('content/main', 'Save befor use it') . '</div>' . Html::submitButton('Save', ['class' => 'btn btn-success'])]]]);
?>

<?php 
echo $form->field($model, 'class', ['template' => '{input}'])->hiddenInput(['value' => $class]);
ActiveForm::end();
?>