[gridView] -- index页面重写
来源:互联网 发布:硫磺岛战役知乎 编辑:程序博客网 时间:2024/05/16 16:19
lulucms post模块index页面源代码
<?phpuse yii\helpers\Html;use source\core\grid\GridView;use source\LuLu;use source\models\Content;use source\libs\Constants;/* @var $this yii\web\View *//* @var $searchModel app\models\search\ContentSearch *//* @var $dataProvider yii\data\ActiveDataProvider */$type='post';$this->title = '文章管理';$this->params['breadcrumbs'][] = $this->title;?><?php $this->toolbars([ Html::a('新建11', ['create'], ['class' => 'btn btn-xs btn-primary mod-site-save']), Html::a('设置', ['setting/index'], ['class' => 'btn btn-xs btn-primary mod-site-save'])]);?> <?= GridView::widget([ 'dataProvider' => $dataProvider, //'filterModel' => $searchModel, //设置布局 'layout' => "{items}\n{pager}", 'columns' => [ [ 'class'=>'source\core\grid\IdColumn', ], [ 'attribute'=>'title', 'headerOptions'=>['width'=>'auto'],//headerOptions可以设置表格标题html属性.如with height等,如果修改内容是contentOptions属性 ], [ 'class'=>'source\core\grid\DateTimeColumn', 'attribute' => 'updated_at', ], //'allow_comment', //'comments', 'userText', 'comment_count', 'view_count', [ 'attribute'=>'status', 'width'=>'25px', 'content'=>function($model,$key,$index,$gridView){ return Constants::getStatusItemsForContent($model->status); }, ], // 'diggs', // 'burys', // 'sticky', // 'password', // 'visibility', //'status', // 'thumb', // // 'alias', // 'excerpt', // 'content:ntext', // 'content_type', // 'template', ['class' => 'source\core\grid\ActionColumn'], ], ]); ?>
IdColumn源代码
<?phpnamespace source\core\grid;class IdColumn extends DataColumn{ public $attribute='id'; public $headerOptions=['width'=>'25px'];//设置id列宽度 //public $contentOptions=['width'=>'25000px']; public function init() { parent::init(); }}
DataColumn源代码
<?phpnamespace source\core\grid;class DataColumn extends \yii\grid\DataColumn{ public $headerOptions = []; public $width = '60px'; public function init() { parent::init(); if (! isset($this->headerOptions['width'])) { $this->headerOptions['width'] = $this->width; } $this->contentOptions=['style'=>'word-wrap: break-word; word-break: break-all;']; }}
DateTimeColumn源代码
<?phpnamespace source\core\grid;class DateTimeColumn extends DataColumn{ public $headerOptions=['width'=>'120px'];//这个是设置index time列宽度 public $format =['datetime', 'php:Y-m-d H:m:s']; public function init() { parent::init(); }}
0 0
- [gridView] -- index页面重写
- 重写GridView
- gridView重写
- GridView RowCommand Index
- 重写WebControl-GridView
- [gridview] -- ActionColumn重写
- URL重写 省略index.php
- 配置nginx重写index.php
- nginx 重写去掉index.php
- nginx 重写去掉index.php
- index页面设置
- index 首页页面跳转
- Apache默认index页面
- springboot设置index页面
- 自定义控件之重写GridView
- 重写GRIDVIEW 控件 asp.net
- 自定义控件之重写GridView
- 重写页面渲染事件
- C#中图片与BASE64码互相转换
- Nginx自建CA配置https服务器
- 半年总结——在路上
- c# 图片按比例缩放
- OpenStack学习笔记(-)-虚拟化
- [gridView] -- index页面重写
- 允许局域网内其他主机访问本地MySql数据库
- Struts2接收请求参数1
- 手机app测试方法(一)基本流程
- 快速排序
- 蓝桥杯 算法提高 9-1九宫格
- [torch]Save initial state(fastlstm)
- 每日一篇算法题——数独
- PHP源码解析笔记2-生命周期和Zend引擎