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


PHP Option::getTypesField方法代码示例

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


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

示例1: function

                    </div>
                </div>
            <?php 
}
?>
        </div>
    </div>

    <?php 
ActiveForm::end();
?>

        <?php 
if (!$model->isNewRecord) {
    $gridColumns = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'width' => '30px', 'header' => '', 'headerOptions' => ['class' => 'kartik-sheet-style']], ['width' => '70px', 'attribute' => 'id'], 'name', ['attribute' => 'type', 'value' => function ($model) {
        return Option::getTypesField()[$model->type];
    }, 'filterType' => yii\grid\GridView::FILTER_POS_HEADER, 'filter' => Option::getTypesField(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control'], 'format' => 'raw'], 'param', 'require', ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'multiple', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'buttons' => ['update' => function ($url, $model, $key) {
        $options = ['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0'];
        return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['/option/update', 'id' => $key], $options);
    }, 'delete' => function ($url, $model, $key) {
        $options = ['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post'];
        return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/option/delete', 'id' => $key], $options);
    }]], ['class' => 'kartik\\grid\\CheckboxColumn', 'headerOptions' => ['class' => 'kartik-sheet-style']]];
    echo GridView::widget(['layout' => "{items}\n{summary}\n{pager}", 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'before' => Html::a('<span class="glyphicon glyphicon-plus"></span> Создать', ['/option/create', 'template_id' => $model->id], ['class' => 'btn btn-success']), 'after' => "<div class='text-right'><b>Выбранные:</b> " . Html::button('<span class="glyphicon glyphicon-trash"></span> Удалить', ['class' => 'btn btn-danger delete-all']) . "</div>", 'heading' => '<h3 class="panel-title">
                                    <i class="glyphicon glyphicon-th-list"></i>
                                    Дополнительные поля документов</h3>'], 'export' => ['fontAwesome' => true], 'bordered' => true, 'striped' => true, 'condensed' => true, 'persistResize' => false, 'hover' => true, 'responsive' => true]);
}
?>

</div>
开发者ID:darkffh,项目名称:yii2-lowbase,代码行数:30,代码来源:_form.php

示例2:

        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'template_id')->dropDownList(Template::getAll());
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'type')->dropDownList(Option::getTypesField());
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'param')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'multiple')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Да', 'offText' => 'Нет'], 'pluginEvents' => ['switchChange.bootstrapSwitch' => 'function(events, state) {
                        var is_req = $("#is_req");
                        if (state) {
开发者ID:darkffh,项目名称:yii2-lowbase,代码行数:31,代码来源:_form.php


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