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


PHP CRequest::getAction方法代码示例

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


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

示例1: checkRight

 /**
  * 是否有权限
  */
 public static function checkRight($thisRoute = null)
 {
     // 用户资源
     $userData = CSession::get('user');
     if ($userData['groupId'] == 1) {
         return true;
     }
     $userRightList = isset($userData['rightAll']) ? $userData['rightAll'] : array();
     // 附加公共资源
     array_push($userRightList, 'system@welcome');
     array_push($userRightList, 'system@navList');
     array_push($userRightList, 'system@addNav');
     array_push($userRightList, 'system@addNavHandle');
     array_push($userRightList, 'system@ajaxAddNav');
     array_push($userRightList, 'system@editNav');
     array_push($userRightList, 'system@editNavHandle');
     array_push($userRightList, 'system@delNav');
     array_push($userRightList, 'system@changeMyPassword');
     array_push($userRightList, 'system@changeMyPassHandle');
     array_push($userRightList, 'adminRole@messageCenterForClient');
     array_push($userRightList, 'system@seeHelp');
     // 转小写
     foreach ($userRightList as $key => $val) {
         $userRightList[$key] = strtolower($val);
     }
     // 获取当前请求的路由
     if ($thisRoute == null) {
         $route = CRequest::getController() . '@' . str_replace(CConfig::getInstance()->load('ACTION_PREFIX'), '', CRequest::getAction());
     } else {
         $route = $thisRoute;
     }
     return in_array(strtolower($route), $userRightList);
 }
开发者ID:seiven,项目名称:ACEAdminForMyframework,代码行数:36,代码来源:AdminController.php

示例2: display

 public function display($templateName = '', $isCache = false, $num = '')
 {
     if (empty($templateName)) {
         $templateName = CRequest::getController() . '/' . str_replace(CConfig::getInstance()->load('ACTION_PREFIX'), '', CRequest::getAction());
     }
     parent::display($templateName, $isCache, $num);
 }
开发者ID:seiven,项目名称:ACEAdminForMyframework,代码行数:7,代码来源:BaseController.php

示例3: setInitData

 /**
  * 设置基础数据
  */
 public static function setInitData($viewObject)
 {
     $prefix = CConfig::getInstance()->load('ACTION_PREFIX');
     $viewObject->assign('thisUrl', urlencode(CRequest::getUrl()));
     $viewObject->assign('base64Url', CEncrypt::safe_b64encode(CRequest::getUrl()));
     $viewObject->assign('controller', CRequest::getController());
     $viewObject->assign('action', CRequest::getAction());
     $viewObject->assign('actionPre', $prefix);
     $viewObject->assign('ip', CRequest::getIp());
     $viewObject->assign('module', CRequest::getModule());
     $viewObject->assign('time', time());
     $viewObject->assign('sessionID', session_id());
     $viewObject->assign('path', CRequest::getPath());
     $viewObject->assign('staticUrl', CConfig::getInstance('site')->load('staticUrl'));
     $viewObject->assign('uploadStaticUrl', CConfig::getInstance('site')->load('uploadStaticUrl'));
     $viewObject->assign('siteName', CConfig::getInstance('site')->load('siteName'));
 }
开发者ID:seiven,项目名称:ACEAdminForMyframework,代码行数:20,代码来源:CSmarty.php


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