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


PHP Student::getGiSizeMap方法代码示例

本文整理汇总了PHP中app\models\Student::getGiSizeMap方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::getGiSizeMap方法的具体用法?PHP Student::getGiSizeMap怎么用?PHP Student::getGiSizeMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Student的用法示例。


在下文中一共展示了Student::getGiSizeMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$options = [];
$options['checkNameUrl'] = Url::to(['/student/check-name']);
$options['getClassesUrl'] = Url::to(['/class/create-student-hand-anchors']);
$this->registerJs("var options = " . JSON::encode($options) . ";", $this::POS_HEAD, 'my-options');
$this->registerJsFile('/js/student-create.js', ['\\app\\assets\\AppAsset']);
$this->title = 'Create Student';
$this->params['breadcrumbs'][] = ['label' => 'Students', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="student-create">
   <h1><?php 
echo Html::encode($this->title);
?>
</h1>
   <?php 
$form = ActiveForm::begin();
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 3, 'attributes' => ['gender' => ['type' => Form::INPUT_DROPDOWN_LIST, 'options' => [], 'items' => ['M' => 'Male', 'F' => 'Female']], 'fname' => ['type' => Form::INPUT_TEXT, 'options' => []], 'lname' => ['type' => Form::INPUT_TEXT, 'options' => []], 'dob' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\datecontrol\\DateControl', 'options' => ['widgetClass' => '\\yii\\widgets\\MaskedInput', 'options' => ['mask' => '99/99/9999']], 'hint' => 'Use mm/dd/yyyy format'], 'bestPhone' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\yii\\widgets\\MaskedInput', 'options' => ['mask' => '(999) 999 9999', 'value' => '', 'name' => 'StudentPhone[number]']], 'belt_size' => ['type' => Form::INPUT_DROPDOWN_LIST, 'items' => Student::getGiSizeMap()], 'division_id' => ['type' => Form::INPUT_DROPDOWN_LIST, 'options' => [], 'items' => [null => ''] + Division::getMap()], 'handAnchor' => ['type' => Form::INPUT_DROPDOWN_LIST, 'options' => ['value' => 0, 'name' => 'Affiliation[hand_anchor_id]'], 'items' => [null => '']]]]);
?>
   <div class="form-group">
      <!--input type="hidden" name="action" id="action" value="" /-->
      <?php 
echo Html::submitButton('Save and Exit', ['class' => 'btn btn-success', 'icon' => 'floppy-disk']);
?>
      <?php 
echo Html::submitButton('Save and Add Another', ['name' => 'then-add', 'class' => 'btn btn-success', 'icon' => 'floppy-disk']);
?>
      <?php 
echo Html::a('Cancel', Url::to(['/student']), ['class' => 'btn btn-primary', 'icon' => 'remove']);
?>
   </div>
</div>
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:31,代码来源:create.php

示例2: function

$this->registerCssFile('/css/student-index.css', ['\\app\\assets\\AppAsset']);
$this->title = 'Students';
$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]);
?>
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:31,代码来源:index.php

示例3:

?>
</td>
         <td/>
         
         <td><?php 
echo $form->field($model, 'fname')->textInput(['maxlength' => 45]);
?>
</td>
         <td><?php 
echo $form->field($model, 'lname')->textInput(['maxlength' => 45]);
?>
</td>
      </tr>
      <tr>
         <td colspan="2"><?php 
echo $form->field($model, 'belt_size')->dropDownList(Student::getGiSizeMap());
?>
</td>
         <td colspan="2"><?php 
echo $form->field($model, 'division_id')->dropDownList(Division::getMap());
?>
</td>
      </tr>
      <tr>
         <td colspan="2"><?php 
echo $form->field($model->affiliation, 'hand_anchor_id')->dropDownList(ArrayHelper::map($model->handAnchors, 'id', 'fullName'));
?>
</td>
         <td colspan="2"><?php 
echo $form->field($model->affiliation, 'weapon_anchor_id')->dropDownList(ArrayHelper::map([null] + $model->weaponAnchors, 'id', 'fullName'));
?>
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:31,代码来源:_form.php


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