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


PHP Zend_Controller_Request_Abstract::getModuleKey方法代码示例

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


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

示例1: _changeDispatch

 private function _changeDispatch(Zend_Controller_Request_Abstract &$request, Zend_Controller_Response_Abstract $response)
 {
     $module = $request->getParam($request->getModuleKey());
     $controller = $request->getParam($request->getControllerKey());
     $action = $request->getParam($request->getActionKey());
     $submodule = '';
     $subcontroller = '';
     $subaction = '';
     if ('admin' != $module) {
         $submodule = $module;
         $subcontroller = $controller ? $controller : 'index';
         $subaction = $action ? $action : 'index';
         $controller = 'index';
         $action = 'subroute';
         $module = 'default';
     } else {
         $submodule = $controller;
         $subcontroller = $action ? $action : 'index';
         //долно быть настроено в route
         //$subaction = ( $action ) ? $action : 'index';
         $controller = 'index';
         $action = 'subroute';
     }
     $request->setParam($request->getModuleKey(), $module);
     $request->setModuleName($module);
     $request->setParam($request->getControllerKey(), $controller);
     $request->setControllerName($controller);
     $request->setParam($request->getActionKey(), $action);
     $request->setActionName($action);
     $request->setParam('submodule', $submodule);
     $request->setParam('subcontroller', $subcontroller);
     $request->setParam('subaction', $subaction);
 }
开发者ID:Aktubius,项目名称:zendframeworkmodification,代码行数:33,代码来源:Dispatcher.php

示例2: init

 /**
  * 初始化
  * 
  * @return void
  */
 public function init()
 {
     //request和response对象获取
     $this->request = $this->getRequest();
     $this->response = $this->getResponse();
     $this->modKey = $this->request->getModuleKey();
     $this->modName = $this->request->getModuleName();
     $this->ctlKey = $this->request->getControllerKey();
     $this->ctlName = $this->request->getControllerName();
     $this->actKey = $this->request->getActionKey();
     $this->actName = $this->request->getActionName();
     //smarty模板设置
     $this->view = Common_View::getInstance();
     //重新设置模板目录
     $_viewBaseDir = implode(DS, array(APP_NOPUBLIC_MODULES_PATH, $this->modName, 'views'));
     $params = array('template_dir' => $_viewBaseDir . DS . 'html', 'compile_dir' => $_viewBaseDir . DS . 'compile', 'cache_dir' => $_viewBaseDir . DS . 'cache');
     $this->view->setViewParams($params);
     unset($_viewBaseDir);
 }
开发者ID:BGCX067,项目名称:f0110abdd74447aa81880248fa8830b6-svn-to-git,代码行数:24,代码来源:Action.php

示例3: _setRequestKeys

 /**
  * Set request keys based on values in request object
  *
  * @return void
  */
 protected function _setRequestKeys()
 {
     if (null !== $this->_request) {
         $this->_moduleKey = $this->_request->getModuleKey();
         $this->_controllerKey = $this->_request->getControllerKey();
         $this->_actionKey = $this->_request->getActionKey();
     }
     if (null !== $this->_dispatcher) {
         $this->_defaults += array($this->_controllerKey => $this->_dispatcher->getDefaultControllerName(), $this->_actionKey => $this->_dispatcher->getDefaultAction(), $this->_moduleKey => $this->_dispatcher->getDefaultModule());
     }
     $this->_keysSet = true;
 }
开发者ID:H38uS,项目名称:Impulsion,代码行数:17,代码来源:Module.php

示例4: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     try {
         // Set Request Object
         $_request[$request->getModuleKey()] = $request->getModuleName();
         $_request[$request->getControllerKey()] = $request->getControllerName();
         $_request[$request->getActionKey()] = $request->getActionName();
         if (PHP_SAPI != 'cli' && $request->getModuleName() != 'cronjob') {
             $_request['url'] = $_SERVER['REQUEST_URI'];
         }
         Monitor_Request::getInstance()->setRequest($_request);
     } catch (Zend_Exception $e) {
         throw $e;
     }
 }
开发者ID:nguyenduong127,项目名称:Project-dll.vn-,代码行数:15,代码来源:Params.php

示例5: routeStartup

 /**
  * Called before Zend_Controller_Front begins evaluating the
  * request against its routes.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
 public function routeStartup(Zend_Controller_Request_Abstract $request)
 {
     $frontController = Zend_Controller_Front::getInstance();
     // Request keys
     $moduleKey = $request->getModuleKey();
     $controllerKey = $request->getControllerKey();
     $actionKey = $request->getActionKey();
     // Defaults
     $moduleName = $frontController->getDefaultModule();
     $controllerName = $frontController->getDefaultControllerName();
     $actionName = $frontController->getDefaultAction();
     // Set a url path
     $module = $request->getQuery($moduleKey, $moduleName);
     $controller = $request->getQuery($controllerKey, $controllerName);
     $action = $request->getQuery($actionKey, $actionName);
     // Assemble
     if ($request->getPathInfo() == '/') {
         $modulePart = $module == $moduleName ? $module : '/' . $module;
         $controllerPart = $controller == $controllerName && $action == $actionName ? '' : '/' . $controller;
         $actionPart = $action == $actionName && $controller ? '' : '/' . $action;
         $request->setPathInfo($modulePart . $controllerPart . $actionPart);
     }
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:30,代码来源:RouteByQuery.php

示例6: _setRequestParams

 /**
  * Sets parameters for request object
  *
  * Module name, controller name and action name
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param array                            $params
  */
 protected function _setRequestParams($request, $params)
 {
     foreach ($params as $param => $value) {
         $request->setParam($param, $value);
         if ($param === $request->getModuleKey()) {
             $request->setModuleName($value);
         }
         if ($param === $request->getControllerKey()) {
             $request->setControllerName($value);
         }
         if ($param === $request->getActionKey()) {
             $request->setActionName($value);
         }
     }
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:23,代码来源:Rewrite.php

示例7: applyRequest

 /**
  * Filters a request for use with applyParameters.
  *
  * @param \Zend_Controller_Request_Abstract $request
  * @param boolean $removePost Optional
  * @param boolean $includeNumericFilters When true numeric filter keys (0, 1, 2...) are added to the filter as well
  * @return \MUtil_Model_ModelAbstract
  */
 public function applyRequest(\Zend_Controller_Request_Abstract $request, $removePost = true, $includeNumericFilters = false)
 {
     $parameters = $request->getParams();
     // Remove MVC fields
     unset($parameters[$request->getModuleKey()], $parameters[$request->getControllerKey()], $parameters[$request->getActionKey()]);
     if ($removePost) {
         // Do not use POST fields for filter
         $parameters = array_diff_key($parameters, $_POST);
     }
     // Remove all empty values (but not arrays) from the filter
     $parameters = array_filter($parameters, function ($i) {
         return is_array($i) || strlen($i);
     });
     $this->applyParameters($parameters, $includeNumericFilters);
     return $this;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:24,代码来源:ModelAbstract.php


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