lulucms Post Module index page source code
<?php use 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\activ
Edataprovider */$type = ' post ';
$this->title = ' article management ';
$this->params[' breadcrumbs ' [] = $this->title; ?> <?php $this->toolbars ([Html::a (' New One ', [' Create '], [' class ' = ' = ' btn btn-xs btn-primary mod-site-save ') ]), html::a (' Settings ', [' Setting/index '], [' class ' = ' btn btn-xs btn-primary mod-site-save ']); > <?= gridview::widget ([' Dataprovider ' + $dataProvider,//' filtermodel ' and ' = ' $searc
Hmodel,//Set layout ' layouts ' = ' {Items}\n{pager} ', ' columns ' = [[ ' Class ' = ' Source\core\grid\idcolumn ',], [' attribute ' = ' t Itle ', ' headeroptions ' =>
[' width ' = ' auto '],//headeroptions can set the table caption HTML property. If the modified content is Contentoptions property], such as with height,
[' 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 Source Code
<?php
namespace Source\core\grid;
Class Idcolumn extends DataColumn
{public
$attribute = ' id ';
Public $headerOptions =[' width ' = ' 25px '];//set the id column width
//public $contentOptions =[' width ' = ' 25000px '];
Public function init ()
{
parent::init ();
}
}
DataColumn Source Code
<?php
namespace 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 Source Code
<?php
namespace Source\core\grid;
Class Datetimecolumn extends DataColumn
{public
$headerOptions =[' width ' = ' 120px '];//This is the setting index Time column width public
$format =[' datetime ', ' php:y-m-d h:m:s '];
Public function init ()
{
parent::init ();
}
}