Example #1
0
<?php

use app\models\tour\TourRecord;
use app\models\hotel\HotelRecord;
use yii\bootstrap\ActiveForm;
use app\widgets\DateTimePicker;
$form = ActiveForm::begin(['layout' => 'horizontal']);
echo $form->field($model, 'name');
echo $form->field($model, 'hotel_id')->dropDownList(HotelRecord::getHotels());
echo $form->field($model, 'children')->dropDownList(TourRecord::children());
echo $form->field($model, 'adults')->dropDownList(TourRecord::adults());
$clientOptions = ['format' => 'DD.MM.YYYY HH:mm:ss'];
$clientOptions['minDate'] = new \yii\web\JsExpression('moment().format("MM.DD.YYYY")');
$options = ['placeholder' => 'дд.мм.гггг ЧЧ:ММ'];
if ($model->isNewRecord) {
    $options['value'] = Yii::$app->formatter->datetimeFormat;
    $clientOptions['minDate'] = new \yii\web\JsExpression('moment().format("MM.DD.YYYY")');
}
echo $form->field($model, 'flyAt')->widget(DateTimePicker::className(), ['options' => $options, 'language' => 'ru', 'clientOptions' => $clientOptions]);
?>

    <div class="clearfix form-actions">
        <div class="col-md-offset-3 col-md-9">
            <?php 
echo \yii\bootstrap\Html::submitButton('Применить', ['class' => 'btn btn-success']);
?>
        </div>
    </div>

<?php 
ActiveForm::end();
Example #2
0
">
            <?php 
echo $form->field($model, 'slug')->textInput(['maxlength' => true]);
?>
        </div>
        <div class="col-sm-<?php 
echo $model->isNewRecord ? 6 : 5;
?>
">
            <?php 
echo $form->field($model, 'seotitle')->textInput(['maxlength' => true]);
?>
        </div>
        <div class="col-sm-3">
            <?php 
echo $model->isNewRecord ? false : $form->field($model, 'created_at')->widget(DateTimePicker::classname(), ['value' => $model->created_at, 'layout' => '{picker}{input}', 'pluginOptions' => ['format' => 'hh:ii - dd.mm.yyyy', 'autoclose' => true, 'todayHighlight' => true]]);
?>
        </div>
    </div>

    <?php 
echo $form->field($model, 'keywords')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'description')->textarea(['rows' => 6]);
?>

</div>

<?php