当前位置: 首页>>代码示例>>PHP>>正文


PHP Authors::getList方法代码示例

本文整理汇总了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' => '']]);
开发者ID:verve000,项目名称:verve000,代码行数:30,代码来源:index.php

示例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"]);
?>
开发者ID:verve000,项目名称:verve000,代码行数:31,代码来源:_form.php


注:本文中的app\models\Authors::getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。