本文整理汇总了PHP中app\models\Student::getSparAuthList方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getSparAuthList方法的具体用法?PHP Student::getSparAuthList怎么用?PHP Student::getSparAuthList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Student
的用法示例。
在下文中一共展示了Student::getSparAuthList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
$this->params['breadcrumbs'][] = $this->title;
$columns = [['class' => 'yii\\grid\\SerialColumn'], ['class' => ToggleColumn::className(), 'attribute' => 'active', 'filter' => ['1' => 'Y', '0' => 'N', '' => 'All'], 'headerOptions' => ['style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center']], ['attribute' => 'gender', 'class' => EditableColumn::className(), 'url' => 'editable', 'contentOptions' => ['class' => 'text-center', 'nowrap' => true], 'headerOptions' => ['class' => 'text-center', 'style' => 'width:20px'], 'type' => 'select', 'filter' => ['M' => 'M', 'F' => 'F', '' => 'All'], 'editableOptions' => ['showbuttons' => false, 'mode' => 'inline', 'source' => '[{"M": "M"}, {"F": "F"}]', 'value' => function ($model) {
return $model->gender;
}]], ['attribute' => 'fname', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['attribute' => 'lname', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['value' => 'division.name', 'header' => 'Div', 'attribute' => 'division_id', 'headerOptions' => ['class' => 'text-center', 'style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center'], 'filter' => Division::getMap() + ['' => 'All'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['showbuttons' => false, 'value' => function ($model) {
return $model->division_id;
}, 'source' => Json::encode(Division::getMap()), 'mode' => 'inline']], ['value' => 'handAnchor.name', 'attribute' => 'handAnchorId', 'header' => 'Anchor', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['showbuttons' => false, 'mode' => 'inline', 'value' => function ($model) {
return $model->affiliation->hand_anchor_id;
}, 'source' => function ($model) {
return Url::to(['/student/available-classes', 'id' => $model->id, 'type' => 'hand']);
}]], ['value' => 'dobAndAge', 'attribute' => 'dob', 'header' => 'DoB & Age', 'contentOptions' => ['nowrap' => true, 'style' => 'width:100px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'combodate', 'editableOptions' => ['value' => function ($model) {
return $model->dob;
}, 'format' => 'YYYY-MM-DD', 'viewformat' => 'M/D', 'template' => 'M / D / YYYY']], ['attribute' => 'belt_size', 'headerOptions' => ['style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center'], 'class' => EditableColumn::className(), 'filter' => Student::getGiSizeMap() + ['' => 'All'], 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['mode' => 'inline', 'showbuttons' => false, 'value' => function ($model) {
return $model->belt_size;
}, 'source' => Json::encode(Student::getGiSizeMap())]], ['attribute' => 'bestPhoneNumber', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['attribute' => 'sparAuth', 'value' => 'sparAuthJson', 'contentOptions' => ['class' => 'text-center'], 'headerOptions' => ['style' => 'width:20px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'checklist', 'editableOptions' => ['value' => function ($model) {
return $model->sparAuthJson;
}, 'display' => new JsExpression("function(value, sourceData)\n { \n var icon = 'remove';\n //console.log(value, sourceData);\n if(value instanceof Array && value[0] !== '')\n {\n \$.each(value, function(i, v)\n {\n if (v.toLowerCase() === 'a')\n {\n icon = 'ok';\n return false;\n }\n else\n {\n icon = 'tasks';\n }\n });\n }\n \$(this).html('<span class=\"glyphicon glyphicon-' + icon + '\"></span>');\n }"), 'mode' => 'pop', 'source' => Json::encode(Student::getSparAuthList())]], ['attribute' => 'rank.name', 'contentOptions' => ['nowrap' => true]], ['attribute' => 'grappleAuth', 'value' => 'grappleAuthJson', 'contentOptions' => ['class' => 'text-center'], 'headerOptions' => ['style' => 'width:20px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'checklist', 'editableOptions' => ['value' => function ($model) {
return $model->grappleAuthJson;
}, 'display' => new JsExpression("function(value, sourceData)\n {\n var icon = 'remove';\n //console.log(value, sourceData);\n if(value instanceof Array && value[0] !== '')\n {\n \$.each(value, function(i, v)\n {\n if (v.toLowerCase() === 'a')\n {\n icon = 'ok';\n return false;\n }\n else\n {\n console.log(v);\n icon = 'tasks';\n }\n });\n }\n \$(this).html('<span class=\"glyphicon glyphicon-' + icon + '\"></span>');\n }"), 'mode' => 'pop', 'source' => Json::encode(Student::getGrappleAuthList())]], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['nowrap' => true], 'template' => '{view} {update}' . (Yii::$app->user->can('deleteStudent') ? ' {delete}' : '')]];
?>
<div class="student-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
//echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
示例2:
?>
</td>
<td colspan="2"><?php
echo $form->field($model->affiliation, 'weapon_anchor_id')->dropDownList(ArrayHelper::map([null] + $model->weaponAnchors, 'id', 'fullName'));
?>
</td>
</tr>
<tr>
<td colspan="4"><?php
echo $form->field($model, 'email')->textInput(['maxlength' => 254]);
?>
</td>
</tr>
<tr>
<td td colspan="4"><?php
echo $form->field($model, 'sparAuth')->checkBoxList(Student::getSparAuthList(true), ['inline' => true]);
?>
</td>
</tr>
<tr>
<td td colspan="4"><?php
echo $form->field($model, 'grappleAuth')->checkboxList(Student::getGrappleAuthList(true), ['inline' => true]);
?>
</td>
</tr>
<tr>
<td colspan="4"><?php
echo $form->field($model, 'notes')->textarea(['rows' => 6]);
?>
</td>
</tr>