本文整理汇总了PHP中app\models\Authors::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Authors::getList方法的具体用法?PHP Authors::getList怎么用?PHP Authors::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Authors
的用法示例。
在下文中一共展示了Authors::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div style="margin-bottom:20px;; float:right;">
<?php
echo Html::a('Добавить книгу', ['create'], ['class' => 'btn btn-success']);
?>
</div><br>
<div>
<?php
$form = ActiveForm::begin(['method' => 'get', 'options' => ['class' => 'form-inline']]);
?>
<div class="form-group">
<?php
echo $form->field($searchModel, 'author_id')->dropDownList(array_merge([0 => 'автор'], Authors::getList()), ['options' => ['class' => 'form-control', $searchModel->author_id => ['selected' => true]]])->label(false);
?>
</div>
<div class="form-group">
<?php
echo $form->field($searchModel, 'name')->textInput(['placeholder' => 'название книги'])->label(false);
?>
</div><br><br>
<?php
echo $form->field($searchModel, 'date_from')->widget(DatePicker::className(), ['language' => 'ru', 'clientOptions' => ['format' => 'yyyy-mm-dd'], 'options' => ['class' => 'form-control', 'readonly' => '']]);
?>
<?php
echo $form->field($searchModel, 'date_to')->widget(DatePicker::className(), ['language' => 'ru', 'clientOptions' => ['format' => 'yyyy-mm-dd'], 'options' => ['class' => 'form-control', 'readonly' => '']]);
示例2:
use app\models\Authors;
use dosamigos\datepicker\DatePicker;
?>
<div>
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(Authors::getList(), ['options' => [$model->author_id => ['selected' => true]]]);
?>
<?php
echo $form->field($model, 'date')->widget(DatePicker::className(), ['language' => 'ru', 'clientOptions' => ['format' => 'yyyy-mm-dd'], 'options' => ['class' => 'form-control', 'readonly' => '']]);
?>
<?php
if ($model->preview) {
echo Html::img($model->getImgSrc(), ['width' => '100', 'class' => 'books-img']);
}
?>
<?php
echo $form->field($model, 'image')->fileInput(["accept" => "image/x-png, image/gif, image/jpeg"]);
?>