Search the Community
Showing results for tags 'modules'.
-
I was able to follow everything you wrote in the book on yii booster and modules and tested everything locally on my mac using MAMP. It worked great. Dropdown menus, tables with dropdown related filtering, editable fields, toggle fields. Beautiful amazing module! I uploaded it to the server and can't get booster to work at all. I changed my yii booster menu to a CMenu version and it works, so I know it's got something to do with how I'm initializing or configuring yii booster. main.php (I can't change the way URLs are done or preload booster for the whole site) 'modules'=>array( // uncomment the following to enable the Gii tool 'gii'=>array( 'class'=>'system.gii.GiiModule', 'password'=>'bypass', // If removed, Gii defaults to localhost only. Edit carefully to taste. 'ipFilters'=>array('68.84.73.165','75.146.203.154','::1','2601:46:4200:3214:fc19:fc58:7775:6454','*'), //enable extension giix 'generatorPaths' => array( 'ext.giix-core'), ), 'admin' => array( // admin module by Melanie 'class' => 'application.modules.admin.AdminModule', 'components' => array( 'booster' => array( 'class' => 'admin.extensions.booster.components.Booster'), ), 'preload' => array('booster'), ), 'pay', // sample stripe payment module ), // application components 'components'=>array( 'booster' => array( 'class' => 'application.modules.admin.extensions.booster.components.Booster', 'responsiveCss'=>true, ), 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>false, ), // prevent CSRF attacks when using cookies set to true // must use CHtml or CActiveForm to create forms to work //'request'=>array( // 'enableCsrfValidation'=>true, //), 'session' => array( 'class' => 'CDbHttpSession', 'autoCreateSessionTable' => true, 'connectionID' => 'db', 'timeout' => 2400, 'autoStart' => true ), // uncomment the following to enable URLs in path-format 'urlManager'=>array( //'urlFormat'=>'path', 'rules'=>array( //'http://admin.pottstownrumble.net' => 'admin/default/index', //'http://admin.pottstownrumble.net/login' => 'admin/default/login', //'http://admin.pottstownrumble.com' => 'admin/default/index', //'http://admin.pottstownrumble.com/login' => 'admin/default/login', //'<controller:\w+>/<id:\d+>'=>'<controller>/view', //'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', //'<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ), AdminModule.php <?php class AdminModule extends CWebModule { public function init() { Yii::app()->setComponents(array( 'errorHandler' => array( 'errorAction' => 'admin/default/error'), 'user' => array( 'class' => 'CWebUser', 'loginUrl' => Yii::app()->createUrl('admin/default/login'), ) )); Yii::app()->user->setStateKeyPrefix('admin'); // this method is called when the module is being created // you may place code here to customize the module or the application // import the module-level models and components $this->setImport(array( 'admin.models.*', 'admin.components.*', 'admin.extensions.*', )); } public function beforeControllerAction($controller, $action) { if(parent::beforeControllerAction($controller, $action)) { // this method is called before any module controller action is performed // you may place customized code here $route = $controller->id . '/' . $action->id; // echo $route; $publicPages = array( 'default/login', 'default/error', ); if (Yii::app()->user->isGuest && !in_array($route, $publicPages)){ Yii::app()->user->loginRequired(); } else return true; } else return false; } } DefaultController.php <?php class DefaultController extends Controller { public $layout = 'xadmin'; /*public function filters() { return array( array('booster.filters.BoosterFilter - delete') ); }*/ public function actionIndex() { $this->render('index'); } /** * Displays the login page */ public function actionLogin() { $model=new LoginForm; // if it is ajax validation request if(isset($_POST['ajax']) && $_POST['ajax']==='login-form') { echo CActiveForm::validate($model); Yii::app()->end(); } // collect user input data if(isset($_POST['LoginForm'])) { $model->attributes=$_POST['LoginForm']; // validate user input and redirect to the previous page if valid if($model->validate() && $model->login()) $this->redirect(Yii::app()->user->returnUrl); } // display the login form $this->render('login',array('model'=>$model)); } /** * Logs out the current user and redirect to homepage. */ public function actionLogout() { Yii::app()->user->logout(false); $this->redirect(Yii::app()->getModule('admin')->user->loginUrl); } public function actionError() { if($error=Yii::app()->errorHandler->error) { if(Yii::app()->request->isAjaxRequest) echo $error['message']; else $this->render('error', $error); } } } Directory Structure: Protected->Modules->admin->extensions is where I put the booster folder I downloaded from the clever tech site. Originally I had it in the Protected->extensions folder, and it worked fine that way until I uploaded it. Then it didn't work. All I got was a blue line across the top of the screen. Can someone help me figure out how to run yii booster on all pages of the admin module? Thanks, Melanie
- 3 replies
-
- yiibooster
- yii1
-
(and 1 more)
Tagged with:
-
I would like to create a forum in one portal. Is there any option in YII to create forums?
- 1 reply
-
- forums
- extensions
-
(and 1 more)
Tagged with: