当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseController::beforeAction方法代码示例

本文整理汇总了PHP中BaseController::beforeAction方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseController::beforeAction方法的具体用法?PHP BaseController::beforeAction怎么用?PHP BaseController::beforeAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseController的用法示例。


在下文中一共展示了BaseController::beforeAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeAction

 public function beforeAction($action)
 {
     if (Yii::app()->user->isGuest) {
         $this->redirect('/');
     }
     return parent::beforeAction($action);
 }
开发者ID:Alamast,项目名称:pravoved,代码行数:7,代码来源:FaqController.php

示例2: beforeAction

 public function beforeAction($action)
 {
     $base = Cshop::$rootpath;
     $jsfilename = $base . "/static/cache/final.js";
     if (!file_exists($jsfilename)) {
         $filename = $base . "/static/js/jquery.js";
         $js = file_get_contents($filename);
         $filename = $base . "/static/js/jquery-ui.js";
         $js .= file_get_contents($filename);
         $filename = $base . "/static/js/jquery.mousewheel.js";
         $js .= file_get_contents($filename);
         $filename = $base . "/static/js/perfect-scrollbar.js";
         $js .= file_get_contents($filename);
         $filename = $base . "/static/js/jquery.placeholder.js";
         $js .= file_get_contents($filename);
         $filename = $base . "/static/js/jquery.noty.packaged.min.js";
         $js .= file_get_contents($filename);
         $filename = $base . "/static/js/script.js";
         $js .= file_get_contents($filename);
         $js = JSMin::minify($js);
         file_put_contents($jsfilename, $js);
     }
     $cssfilename = $base . "/static/cache/final.css";
     if (!file_exists($cssfilename)) {
         $filename = $base . "/static/css/style.css";
         $css = file_get_contents($filename);
         $filename = $base . "/static/css/perfect-scrollbar.css";
         $css .= file_get_contents($filename);
         $minify = new CSSmin();
         $css = $minify->run($css, true);
         file_put_contents($cssfilename, $css);
     }
     return parent::beforeAction($action);
 }
开发者ID:aliazizi,项目名称:CShop,代码行数:34,代码来源:Controller.php

示例3: beforeAction

 public function beforeAction($action)
 {
     $noAuthActions = ['get-faqs'];
     if (in_array($action->id, $noAuthActions)) {
         return true;
     }
     return parent::beforeAction($action);
 }
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:8,代码来源:FaqController.php

示例4: beforeAction

 protected function beforeAction($action)
 {
     // Sample code to be used when RBAC is fully implemented.
     //		if (!Yii::app()->user->checkAccess('admin')) {
     //			throw new CHttpException(403, 'You are not authorised to perform this action.');
     //		}
     return parent::beforeAction($action);
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:8,代码来源:ProcedureController.php

示例5: beforeAction

 protected function beforeAction($action)
 {
     $route = $this->id . '/' . $action->id;
     if (!$this->allowIp(Yii::app()->request->userHostAddress) and $route !== 'main/error') {
         throw new CHttpException(403, "У вас недостаточно прав для просмотра данной страницы. Ваш IP-адрес: " . Yii::app()->request->userHostAddress);
     }
     return parent::beforeAction($action);
 }
开发者ID:rash012,项目名称:cms,代码行数:8,代码来源:BackEndController.php

示例6: beforeAction

 protected function beforeAction($action)
 {
     // Pull in the admin layout controls for ease of UI setup
     Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10);
     Yii::app()->assetManager->registerCssFile('components/font-awesome/css/font-awesome.css', null, 10);
     $this->manager = new WorklistManager();
     return parent::beforeAction($action);
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:8,代码来源:WorklistController.php

示例7: beforeAction

 public function beforeAction($action)
 {
     $before = parent::beforeAction($action);
     $assetManager = Yii::app()->getAssetManager();
     $assetManager->getClientScript()->reset();
     $this->user = User::model()->findByPk(Yii::app()->user->id);
     return $before;
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:8,代码来源:BaseDashboardController.php

示例8: beforeAction

 public function beforeAction($action)
 {
     $userid = Yii::app()->session['user']->id;
     if ($userid != 2103 and $userid != 122 and $userid != 613 and $userid != 1330 and $userid != 1) {
         return false;
     }
     return parent::beforeAction($action);
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:8,代码来源:AuditController.php

示例9: beforeAction

 protected function beforeAction($action)
 {
     Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10);
     Yii::app()->assetManager->registerCssFile('components/font-awesome/css/font-awesome.css', null, 10);
     Yii::app()->assetManager->registerScriptFile('js/admin.js', null, 10);
     $this->jsVars['items_per_page'] = $this->items_per_page;
     return parent::beforeAction($action);
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:8,代码来源:BaseAdminController.php

示例10: beforeAction

 protected function beforeAction($action)
 {
     Yii::app()->assetManager->registerCssFile('css/admin.css', null, 10);
     Yii::app()->assetManager->registerScriptFile('js/admin.js', null, 10);
     $this->jsVars['items_per_page'] = $this->items_per_page;
     if (!empty($_POST['GenericAdminModel'])) {
         $this->handleGenericAdmin();
     }
     return parent::beforeAction($action);
 }
开发者ID:openeyeswales,项目名称:OpenEyes,代码行数:10,代码来源:BaseAdminController.php

示例11: beforeAction

 protected function beforeAction($action)
 {
     if (!Yii::app()->params['profile_user_can_edit']) {
         $this->redirect('/');
     }
     Yii::app()->assetManager->registerCssFile('css/admin.css');
     Yii::app()->assetManager->registerScriptFile('js/profile.js');
     $this->jsVars['items_per_page'] = $this->items_per_page;
     return parent::beforeAction($action);
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:10,代码来源:ProfileController.php

示例12: beforeAction

 protected function beforeAction($action)
 {
     parent::storeData();
     $this->firm = Firm::model()->findByPk($this->selectedFirmId);
     if (!isset($this->firm)) {
         // No firm selected, reject
         throw new CHttpException(403, 'You are not authorised to view this page without selecting a firm.');
     }
     return parent::beforeAction($action);
 }
开发者ID:openeyeswales,项目名称:OpenEyes,代码行数:10,代码来源:PatientController.php

示例13: beforeAction

 function beforeAction()
 {
     define('AUTH_REQUIRED', true);
     parent::beforeAction();
     $this->set("tab", 'index');
     $this->setWrapperDir("/admin");
     $this->aNav = $this->backend->getNavigationTree();
     $this->set('aNav', $this->aNav);
     $this->aPages = $this->backend->getPages();
     $this->set('aPages', $this->aPages);
 }
开发者ID:robinraintama,项目名称:parse-php-cms,代码行数:11,代码来源:admincontroller.php

示例14: beforeAction

 public function beforeAction($action)
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         CShop::app()->getCache()->flush();
     }
     if ($action != 'login') {
         $this->user->isLogin('login.php');
     } elseif ($this->user->isLogin()) {
         CShop::app()->redirect('index.php');
     }
     return parent::beforeAction($action);
 }
开发者ID:aliazizi,项目名称:CShop,代码行数:12,代码来源:adminController.php

示例15: beforeAction

 public function beforeAction(CAction $action)
 {
     // Если заход на страницу авторизации или на заглушку - пускаем
     if (in_array($action->id, array('login', 'cap'))) {
         return parent::beforeAction($action);
     }
     // Если установлено "Закрыть общий доступ к сайту" и при этом смотрит не админ -
     // Показываем заглушку
     if (Yii::app()->config->adminonly and Yii::app()->user->isGuest) {
         $this->redirect('/site/cap');
     }
     return parent::beforeAction($action);
 }
开发者ID:rash012,项目名称:cms,代码行数:13,代码来源:FrontEndController.php


注:本文中的BaseController::beforeAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。