示例#1
0
/* @var $form yii\widgets\ActiveForm */
?>

<div class="books-search">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
$dataoutW = $form->field($model, 'dateout', ['template' => '<div class="col-sm-1"> до </div>
                                                                <div class="col-sm-4">{input}</div>'])->textInput()->widget(DatePicker::classname(), ['value' => date('y-m-d'), 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
$templateDate = ['template' => '<div class="row"><div class="col-md-2">Дата выхода книги от </div><div class="col-sm-4">{input}</div>' . $dataoutW . '</div>'];
?>

    <div class="row">
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'author_id')->dropDownList(\app\models\Authors::map(), ['prompt' => 'автор']);
?>
        </div>
        <div class="col-md-4">
            <?php 
echo $form->field($model, 'name')->textInput(['placeholder' => 'название книги']);
?>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-8">
    <?php 
echo $form->field($model, 'datein', $templateDate)->textInput()->widget(DatePicker::classname(), ['value' => date('y-m-d'), 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
?>
        </div>
        <div class="col-sm-3">