_form.php
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Page */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="page-form">
<?php $form = ActiveForm::begin(); ?>
<h2><?= Yii::t('field', 'common'); ?></h2>
<?= $form->field($model, 'date_add')->widget(\yii\jui\DatePicker::classname(), [
'language' => yii::$app->language,
'dateFormat' => 'yyyy-MM-dd',
]) ?>
<?= $form->field($model, 'template_id')->textInput() ?>
<?= $form->field($model, 'image_id')->textInput() ?>
<?= $form->field($model, 'show')->dropDownList(['1' => Yii::t('action', 'show'), '0' => Yii::t('action', 'hide')]) ?>
<h2><?= Yii::t('field', 'lang'); ?></h2>
<?= $form->field($model, 'title')->textInput() ?>
<?= $form->field($model, 'meta_title')->textarea() ?>
<?= $form->field($model, 'meta_description')->textarea() ?>
<?= $form->field($model, 'text')->textarea(['row' => 4]) ?>
<?= $form->field($model, 'page_alias')->textInput() ?>
<div class="form-group">
<?= Html::submitButton(
$model->isNewRecord ?
Yii::t('action', 'add') :
Yii::t('action', 'update'),
['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']
) ?>
</div>
<?php ActiveForm::end(); ?>
</div>