本文整理匯總了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>