本文整理匯總了PHP中app\models\Authors::getAllAuthors方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authors::getAllAuthors方法的具體用法?PHP Authors::getAllAuthors怎麽用?PHP Authors::getAllAuthors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Authors
的用法示例。
在下文中一共展示了Authors::getAllAuthors方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
echo $form->field($model, 'date_create')->textInput();
?>
<?php
echo $form->field($model, 'date_update')->textInput();
?>
<?php
echo $form->field($model, 'preview')->fileInput();
?>
<?php
echo $form->field($model, 'date')->textInput();
?>
<?php
echo $form->field($model, 'author_id')->dropDownList(Authors::getAllAuthors());
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例2:
use app\models\Authors;
/* @var $this yii\web\View */
/* @var $model app\models\BooksSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="books-search">
<?php
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get', 'options' => ['style' => 'margin-bottom: 50px']]);
?>
<div class="row">
<div class="col-md-3">
<?php
echo $form->field($model, 'author_id', ['template' => '{input}'])->dropDownList(Authors::getAllAuthors(), ['class' => 'form-control', 'placeholder' => Yii::t('app', 'Автор')]);
?>
</div>
<div class="col-md-3">
<?php
echo $form->field($model, 'name', ['template' => '{input}'])->textInput(['class' => 'form-control', 'placeholder' => Yii::t('app', 'Название книги')]);
?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<?php
echo $form->field($model, 'date_from', ['template' => '<div class="pull-left label-custom">{label}</div><div class="pull-left">{input}</div>'])->textInput(['class' => 'form-control'])->label(Yii::t('app', 'Дата выхода книги:'));
?>
</div>