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


PHP DynaGrid::end方法代码示例

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


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

示例1: isset

                    return $model->getImageUrl() ? $model->getImageUrl() : '';
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_DATE:
                $columns[] = ['attribute' => $attr, 'format' => ['raw', ['width' => '100']], 'value' => function ($data) use($attr) {
                    return Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->dateFormat) . ' <small style="color:gray;">' . Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->timeFormat) . '</small>';
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_BOOLEAN:
                $columns[] = ['attribute' => $attr, 'format' => 'raw', 'value' => function ($data) use($attr) {
                    return Html::checkbox($attr, $data->{$attr});
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_DROPDOWN:
                $columns[] = ['attribute' => $attr, 'value' => function ($data) use($attr, $value) {
                    return isset($value['items'][$data->{$attr}]) ? $value['items'][$data->{$attr}] : '';
                }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $value['items'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---'], 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            default:
                $columns[] = ['attribute' => $attr, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
        }
    }
}
if (class_exists('\\stepancher\\adminlteTheme\\config\\AnminLteThemeConfig')) {
    DynaGrid::begin(\yii\helpers\ArrayHelper::merge(\stepancher\adminlteTheme\config\AnminLteThemeConfig::getDefaultConfigDynagrid(), ['columns' => $columns, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['after' => Html::a('<i class="icon glyphicon fa fa-reply"></i> &nbsp&nbspВосстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]]));
} else {
    DynaGrid::begin(['columns' => $columns, 'toggleButtonGrid' => ['label' => '<i class="glyphicon glyphicon-wrench"></i> &nbsp&nbspНастройки'], 'toggleButtonFilter' => ['label' => '<i class="glyphicon glyphicon-filter"></i> &nbsp&nbsp Фильтры'], 'toggleButtonSort' => ['label' => '<i class="glyphicon glyphicon-sort"></i> &nbsp&nbsp Сортировка'], 'storage' => DynaGrid::TYPE_DB, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Сбросить', [''], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Обновить'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}{toggleData}'], '{export}'], 'export' => ['label' => 'Экспорт'], 'panel' => ['footer' => false, 'after' => Html::a('<i class="icon glyphicon fa fa-reply"></i> &nbsp&nbspВосстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]]);
}
DynaGrid::end();
开发者ID:heartshare,项目名称:yii2-content-module,代码行数:30,代码来源:archive.php


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