示例#1
0
use app\models\Authors;
/* @var $this yii\web\View */
/* @var $model app\models\BooksSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<br>
<div class="books-search clearfix">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>
    <div class="col-xs-6">
        <div class="form-group">
            <div class="col-xs-6">
                <?php 
echo $form->field($model, 'author_id')->dropDownList(array_merge([0 => 'Выберите автора'], Authors::getItems()))->label(false);
?>
            </div>
            <div class="col-xs-6">
                <?php 
echo $form->field($model, 'name')->textInput(['placeholder' => $model->getAttributeLabel('name')])->label(false);
?>
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12 align-fd-inputs">
                Дата выхода книги:
                <?php 
echo $form->field($model, 'date_start', ['template' => '{input}'])->textInput(['class' => 'form-control datepicker'])->label(false);
?>
                до
示例#2
0
文件: _form.php 项目: ustkirill/test2
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

    <?php 
echo $form->field($model, 'preview')->fileInput();
?>

    <?php 
echo $form->field($model, 'date')->textInput(['class' => 'form-control datepicker']);
?>

    <?php 
echo $form->field($model, 'author_id')->dropDownList(Authors::getItems());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>