本文整理汇总了PHP中app\models\Books::getAuthors方法的典型用法代码示例。如果您正苦于以下问题:PHP Books::getAuthors方法的具体用法?PHP Books::getAuthors怎么用?PHP Books::getAuthors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Books
的用法示例。
在下文中一共展示了Books::getAuthors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\BooksSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="books-search">
<?php
$form = ActiveForm::begin(['action' => ['serchbook'], 'method' => 'get']);
?>
<?php
echo $form->field($model, 'authors')->dropDownList(\app\models\Books::getAuthors());
?>
<div class="form-group">
<?php
echo Html::submitButton('Искать', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例2:
<div class="books-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'book_category_id')->dropDownList(Books::getCategorys());
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'authors')->listBox(Books::getAuthors(), ['class' => 'multi-select2', 'multiple' => true]);
?>
<?php
echo $form->field($model, 'annotation')->widget(\vova07\imperavi\Widget::className(), ['settings' => ['lang' => 'ru', 'minHeight' => 120, 'plugins' => ['clips', 'fullscreen']]]);
?>
<?php
echo $form->field($model, 'year')->textInput(['maxlength' => true, 'class' => 'mask_year form-control']);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Создать' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
<a href="/books" class="btn">Отмена</a>