/** * Lists all Role models. * @return mixed */ public function actionIndex() { $categoryId = LuLu::getGetValue('category_id'); //$searchModel = new RoleSearch(); $query = Role::find(); $query->andFilterWhere(['category_id' => $categoryId]); $dataProvider = $this->getDataProvider($query); return $this->render('index', ['dataProvider' => $dataProvider]); }
public function actionList() { $takonomy = LuLu::getGetValue('takonomy'); $takonomyModel = Takonomy::getOneOrDefault($takonomy); $query = Content::find(); $query->where(['content_type' => $this->content_type]); $query->andFilterWhere(['takonomy_id' => $takonomy]); $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 10]); $locals['takonomyModel'] = $takonomyModel; return $this->render('list_default', $locals); }
public function actionIndex() { $taxonomy = LuLu::getGetValue('taxonomy'); $query = Content::find(); $query->where(['content_type' => $this->content_type]); $query->andFilterWhere(['taxonomy_id' => $taxonomy]); if ($taxonomy === null) { $taxonomyModel = Taxonomy::findOne(['id' => $taxonomy]); } else { $taxonomyModel = ['id' => null, 'name' => '所有']; } $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 10]); $locals['taxonomyModel'] = $taxonomyModel; return $this->render('index', $locals); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Category::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); $this->type = LuLu::getGetValue('type'); $query->andWhere(['type' => $this->type]); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Permission::find(); $query->orderBy('id asc,sort_num desc'); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); $this->category_id = LuLu::getGetValue('category'); $query->andWhere(['category_id' => $this->category_id]); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['category_id' => $this->category_id, 'form' => $this->form]); $query->andFilterWhere(['like', 'id', $this->id])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'description', $this->description]); return $dataProvider; }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Fragment1Data::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->fragment_id = LuLu::getGetValue('fid'); $query->andFilterWhere(['fragment_id' => $this->fragment_id]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // $query->andFilterWhere([ // 'id' => $this->id, // 'fragment_id' => $this->fragment_id, // 'sort_num' => $this->sort_num, // 'status' => $this->status, // ]); $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'content', $this->content]); return $dataProvider; }
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\ActiveForm; use yii\widgets\ActiveFormAsset; use source\LuLu; /* @var $this yii\web\View */ /* @var $searchModel app\modules\rbac\models\search\RelationSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $user = LuLu::getGetValue('user'); $this->title = '用户名:' . $user; $this->params['breadcrumbs'][] = ['label' => '指派角色', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="relation-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php $form = ActiveForm::begin(); ?> <div> <ul>
<?php use yii\helpers\Html; use source\core\grid\GridView; use yii\helpers\Url; use source\LuLu; use source\modules\rbac\models\Role; use source\libs\Resource; /* @var $this yii\web\View */ /* @var $searchModel app\modules\rbac\models\search\RoleSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $categoryId = LuLu::getGetValue('category'); $this->title = '角色管理'; $this->params['breadcrumbs'][] = $this->title; $columns = [['attribute' => 'id', 'width' => '120px;'], ['attribute' => 'name', 'width' => '120px;'], ['attribute' => 'description', 'width' => 'auto'], ['class' => 'source\\core\\grid\\ActionColumn', 'template' => '{permission}{update} {delete}', 'buttons' => ['permission' => function ($url, $model) { return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/key.png">', Url::to(['relation', 'role' => $model['id']]), ['title' => '设置权限']); }, 'delete' => function ($url, $model) { if ($model->is_system) { return ''; } return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/cross.png">', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']); }]]]; ?> <?php $this->toolbars([Html::a('新建', ['create', 'category' => $categoryId], ['class' => 'btn btn-xs btn-primary mod-site-save'])]); ?> <style> .ui-tabs .ui-tabs-panel{padding:0px;} </style>
<?php use yii\helpers\Html; use yii\helpers\Url; use source\LuLu; use source\libs\Constants; use source\core\grid\GridView; use source\modules\fragment\models\Fragment; use source\libs\Resource; /* @var $this source\core\back\BackView */ /* @var $searchModel source\modules\fragment\models\search\FragmentSearch */ /* @var $dataProvider source\core\data\ActiveDataProvider */ $type = LuLu::getGetValue('type'); $this->title = Fragment::getTypeItems($type); $this->params['breadcrumbs'][] = $this->title; $this->toolbars([Html::a('新建', ['create', 'type' => $type], ['class' => 'btn btn-xs btn-primary mod-site-save'])]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'source\\core\\grid\\IdColumn'], 'code', ['attribute' => 'name', 'width' => '250px', 'value' => function ($model, $key, $index, $column) { $indexUrl = Url::to(['fragment' . $model->type . '-data/index', 'fid' => $model->id, 'type' => $model->type]); return Html::a($model->name, $indexUrl); }], ['attribute' => 'description', 'width' => 'auto'], ['class' => 'source\\core\\grid\\ActionColumn', 'width' => '60px', 'template' => '{data-create}{update} {delete}', 'buttons' => ['data-create' => function ($url, $model, $key, $index, $gridView) { $addUrl = Url::to(['fragment' . $model->type . '-data/create', 'fid' => $model->id, 'type' => $model->type]); return Html::a('<img src="' . Resource::getAdminUrl() . '/images/icons/color/text_signature.png">', $addUrl, ['title' => '添加内容']); }]]]]); ?>
public function init() { parent::init(); $this->category_id = LuLu::getGetValue('category'); }
<?php use yii\helpers\Html; use yii\helpers\Url; use source\LuLu; use source\libs\Constants; use source\core\grid\GridView; use source\modules\fragment\models\Fragment; /* @var $this source\core\back\BackView */ /* @var $searchModel source\modules\fragment\models\search\Fragment2DataSearch */ /* @var $dataProvider source\core\data\ActiveDataProvider */ $fid = LuLu::getGetValue('fid'); $fragmentModel = Fragment::findOne(['id' => $fid]); $this->title = $fragmentModel->name . '(静态碎片)'; $this->params['breadcrumbs'][] = $this->title; $this->toolbars([Html::a('返回', ['fragment/index', 'type' => 2], ['class' => 'btn btn-xs btn-primary mod-site-save']), Html::a('新建', ['create', 'fid' => $fid], ['class' => 'btn btn-xs btn-primary mod-site-save'])]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'source\\core\\grid\\IdColumn'], ['attribute' => 'title', 'width' => 'auto', 'value' => function ($model, $key, $index, $column) { return Html::a($model->title, ['fragment2-data/update', 'id' => $model->id, 'type' => 2, 'fid' => $model->fragment_id]); }], ['label' => '图片', 'value' => function ($model) { return $model->thumb; }, 'format' => 'image'], ['class' => 'source\\core\\grid\\DateTimeColumn', 'attribute' => 'created_at'], ['class' => 'source\\core\\grid\\SortColumn'], ['class' => 'source\\core\\grid\\StatusColumn'], ['class' => 'source\\core\\grid\\ActionColumn']]]); ?> </div>
<?php use yii\helpers\Html; use source\core\widgets\ActiveForm; use source\libs\Common; use source\libs\Constants; use source\LuLu; /* @var $this source\core\back\BackView */ /* @var $model source\modules\fragment\models\Fragment2Data */ /* @var $form source\core\widgets\ActiveForm */ ?> <?php $this->toolbars([Html::a('返回', ['index', 'fid' => LuLu::getGetValue('fid')], ['class' => 'btn btn-xs btn-primary mod-site-save'])]); ?> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data', 'class' => 'da-form']]); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => 256]); echo $form->field($model, 'sub_title')->textInput(['maxlength' => 256]); ?> <!-- <?php
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\ActiveForm; use yii\widgets\ActiveFormAsset; use source\LuLu; /* @var $this yii\web\View */ /* @var $searchModel app\modules\rbac\models\search\RelationSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $role = LuLu::getGetValue('role'); $this->title = '设定权限'; $this->params['breadcrumbs'][] = ['label' => '角色管理', 'url' => ['role/index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="relation-index"> <h1><?php echo $role; ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php $form = ActiveForm::begin(); ?> <?php