本文整理匯總了PHP中app\models\Authors::map方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authors::map方法的具體用法?PHP Authors::map怎麽用?PHP Authors::map使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Authors
的用法示例。
在下文中一共展示了Authors::map方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: date
/* @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">