culture-pn-psu / yii2-cms
Yii 2 CMS from culture-pn-psu Tech
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 4
Open Issues: 0
Type:yii2-extension
Requires
- 2amigos/yii2-ckeditor-widget: ^2.0
- andatech/yii2-filemanager: dev-master
- culture-pn-psu/yii2-user: dev-master
- kartik-v/yii2-detail-view: *
- kartik-v/yii2-export: *
- kartik-v/yii2-grid: @dev
- kartik-v/yii2-mpdf: *
- kartik-v/yii2-tree-manager: @dev
- kartik-v/yii2-widgets: *
- maxmirazh33/yii2-uploadable-cropable-image: *
- sunhater/kcfinder: dev-master
- wbraganca/yii2-fancytree-widget: *
- wbraganca/yii2-nested-set-behavior: *
- wowkaster/yii2-serialize-attributes: dev-master
- yii2tech/ar-softdelete: *
This package is not auto-updated.
Last update: 2024-11-09 20:39:38 UTC
README
Yii 2 CMS from Anda Tech
Main config
... 'bootstrap' => [ 'log', 'web-admin', ], ... 'modules' => [ 'web-admin' => [ 'class' => 'culturePnPsu\cms\Module', 'tablePrefix' => 'web_', 'uploadDir' => '@uploads/web-cms/', 'uploadUrl' => '/uploads/anda-cms' ] ], 'components' => [ ... 'andacms' => [ 'class' => 'culturePnPsu\cms\components\API', ], ... ]
Sample Controller
public function actionIndex() { $model = Yii::$app->andacms->getChildModule('news'); $searchModel = $model->getSearchModel(); $dataProvider = $model->getDataProvider(); return $this->render('index',[ 'dataProvider' => $dataProvider, 'searchModel' => $searchModel, ]); } public function actionView($id) { $model = Yii::$app->andacms->getChildModule('news')->view($id); if (Yii::$app->request->isAjax){ return $this->renderAjax('view',[ 'model' => $model ]); } return $this->render('view',[ 'model' => $model ]); } public function actionFrontpage() { $render = Data::cache('frontpage'.ucfirst($this->id), 3600, function(){ $model = Yii::$app->andacms->getChildModule($this->id); $model->getSearchModel(); $dataProvider = $model->getDataProvider(); $dataProvider->pagination->pageSize=$this->frontpageLimitItems; return $this->renderPartial('frontpage',[ 'dataProvider' => $dataProvider ]); }); return $render; } public function actionCategory($id) { $categoryModel = Yii::$app->andacms->getChildModule('category')->get($id); $searchModel = Yii::$app->andacms->getChildModule($this->id)->getSearchModel(); $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams()); $dataProvider->query->andFilterWhere(['category_id' => $id]); return $this->render('category',[ 'dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'categoryModel' => $categoryModel ]); }