本文整理汇总了PHP中app\models\Student::getLevelsList方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getLevelsList方法的具体用法?PHP Student::getLevelsList怎么用?PHP Student::getLevelsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Student
的用法示例。
在下文中一共展示了Student::getLevelsList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'email')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'email']]);
?>
<?php
echo $form->field($model, 'birthdate')->widget(DatePicker::className(), ['inline' => true, 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
<?php
echo $form->field($model, 'level')->dropDownList(Student::getLevelsList());
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例2: function
<?php
}
?>
<?php
if (!empty($teachersNames)) {
?>
<h2>Учителя</h2>
<ul>
<li><h3><?php
echo $teachersNames[0];
?>
</h3></li>
<li><h3><?php
echo $teachersNames[1];
?>
</h3></li>
</ul>
<h2>Ученики</h2>
<?php
}
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'email:email', ['attribute' => 'birthdate', 'value' => 'birthdate', 'format' => 'html', 'contentOptions' => ['style' => 'width:200px;']], ['attribute' => 'level', 'content' => function ($data) {
return $data->getLevelName();
}, 'filter' => Student::getLevelsList()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
</div>