getKeyValuePairs() public static method

public static getKeyValuePairs ( )
Beispiel #1
0
       'pluginOptions' => [
           'allowClear' => true,
           'minimumInputLength' => 3,
           'ajax' => [
               'url' => Url::to(['/school/name-filter']),
               'dataType' => 'json',
               'data' => new JsExpression('function(params) { return {q:params.term}; }')
           ],
           'escapeMarkup' => new JsExpression('function (markup) { return markup; }'),
           'templateResult' => new JsExpression('function (store) { return store.text; }'),
           'templateSelection' => new JsExpression('function (store) { return store.text; }'),
       ]
   ])*/
?>
        <?php 
echo $form->field($model, 'school_id')->dropDownList(School::getKeyValuePairs());
?>
        <?php 
echo $form->field($model, 'address');
?>
        <?php 
echo $form->field($model, 'cellphone');
?>
        <?php 
echo $form->field($model, 'telephone');
?>
        <?php 
echo $form->field($model, 'hours');
?>
        <?php 
echo $form->field($model, 'enable_sms')->checkbox();
Beispiel #2
0
/* @var $content string */
AppAsset::register($this);
$this->beginContent('@app/views/layouts/base.php');
?>
<!-- School modal starts -->
<div class="modal fade" id="modal-school" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4>切换学校</h4>
            </div>
            <div class="modal-body">
                <ul class="list-unstyled">
                    <?php 
foreach (School::getKeyValuePairs() as $key => $name) {
    ?>
                    <li><?php 
    echo Html::a($name, ['/school/index', 'id' => $key], ['class' => 'btn btn-default btn-fill']);
    ?>
</li>
                    <?php 
}
?>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--/ School modal ends -->
<?php 
Beispiel #3
0
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\models\Admin;
use common\models\Store;
use common\models\School;
$this->title = $model->isNewRecord ? '添加营业点用户' : '更新营业点用户';
?>
<div class="row">
    <div class="col-lg-6">
    <?php 
$form = ActiveForm::begin(['enableAjaxValidation' => true, 'options' => ['autocomplete' => 'off']]);
?>
        <div class="form-group">
            <label class="control-label">学校</label>
            <?php 
echo Html::dropDownList('school', $model->isNewRecord ? '' : $model->store->school_id, School::getKeyValuePairs(), ['class' => 'form-control']);
?>
        </div>
        <?php 
echo $form->field($model, 'store_id')->dropDownList($model->isNewRecord ? [] : Store::getKeyValuePairs($model->store->school_id));
?>
        <?php 
echo $form->field($model, 'username')->textInput(['autocomplete' => 'off']);
?>
        <?php 
echo $form->field($model, 'password')->passwordInput(['autocomplete' => 'off']);
?>
        <?php 
echo $form->field($model, 'email')->input('email');
?>
        <?php 
 public function actionAll()
 {
     return School::getKeyValuePairs();
 }