• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Controller_Request_Http类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: match

 /**
  * Validate and Match Cms Page and modify request
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  *
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('cms_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return Mage::getControllerInstance('Mage_Core_Controller_Varien_Action_Forward', $request, Mage::app()->getFrontController()->getResponse());
     }
     if (!$condition->getContinue()) {
         return null;
     }
     $page = Mage::getModel('Mage_Cms_Model_Page');
     $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());
     if (!$pageId) {
         return null;
     }
     $request->setModuleName('cms')->setControllerName('page')->setActionName('view')->setParam('page_id', $pageId);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return Mage::getControllerInstance('Mage_Core_Controller_Varien_Action_Forward', $request, Mage::app()->getFrontController()->getResponse());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:35,代码来源:Router.php


示例2: match

 /**
  * Match a specific route for an already matched prefix.
  *
  * @see XenForo_Route_Interface::match()
  */
 public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
 {
     $components = explode('/', $routePath);
     $action = strtolower(array_shift($components));
     if (count($components) == 1) {
         // permission/<action>, etc
         $action .= reset($components);
     } else {
         switch ($action) {
             case 'permission':
                 // permission/<group>/<permission>/<action>
                 $request->setParam('permission_group_id', array_shift($components));
                 $request->setParam('permission_id', array_shift($components));
                 break;
             case 'permission-group':
                 // permission-group/<group>/<action>
                 $request->setParam('permission_group_id', array_shift($components));
                 break;
             case 'interface-group':
                 // interface-group/<group>/<action>
                 $request->setParam('interface_group_id', array_shift($components));
                 break;
         }
         $action .= implode('', $components);
     }
     return $router->getRouteMatch('XenForo_ControllerAdmin_Permission', $action, 'permissionsDevelopment');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:32,代码来源:Permissions.php


示例3: match

 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('magicproduct_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     if (!in_array($identifier, $this->router)) {
         return false;
     }
     $request->setModuleName('magicproduct')->setControllerName('index')->setActionName('product')->setParam('type', $identifier);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
开发者ID:uibar,项目名称:laviniailies2,代码行数:25,代码来源:Router.php


示例4: geraTagXml

 private static function geraTagXml($type)
 {
     $request = new \Zend_Controller_Request_Http();
     $arrRequest = explode('/', $request->getRequestUri());
     if (!empty($arrRequest[3])) {
         $rota = (string) $arrRequest[1] . '/' . $arrRequest[2] . '/' . $arrRequest[3];
     } else {
         $rota = (string) $arrRequest[1] . '/' . $arrRequest[2];
     }
     $xml = "<schema>";
     $xml .= "<nome>corporativo</nome>";
     $xml .= "<rota>{$rota}</rota>";
     $xml .= "<tabela>";
     foreach ($type as $key => $value) {
         $nomeTabela = self::converteString($key);
         $xml .= "<nome>" . $nomeTabela . "</nome>";
         foreach ($value as $k => $v) {
             if (!is_array($v) && !is_object($v)) {
                 $xml .= "<coluna>";
                 $palavraConvertida = self::converteString($k);
                 $v = self::procuraData($palavraConvertida) ? self::converteData($v) : $v;
                 $xml .= "<nome>" . $palavraConvertida . "</nome>";
                 $xml .= "<valor>" . $v . "</valor>";
                 $xml .= "</coluna>";
             }
         }
     }
     $xml .= "</tabela>";
     $xml .= "</schema>";
     return $xml;
 }
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:31,代码来源:LoggerWs.php


示例5: match

 public function match(Zend_Controller_Request_Http $request)
 {
     //default route (404)
     $d = explode('/', Mage::getStoreConfig('web/default/no_route'));
     $request->setModuleName(isset($d[0]) ? $d[0] : 'core')->setControllerName(isset($d[1]) ? $d[1] : 'index')->setActionName(isset($d[2]) ? $d[2] : 'index');
     return true;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:7,代码来源:Default.php


示例6: match

 /**
  * Validate and Match Cms Page and modify request
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (Mage::app()->getStore()->isAdmin()) {
         return false;
     }
     $pathInfo = $request->getPathInfo();
     // remove suffix if any
     $suffix = Mage::helper('amlanding/url')->getSuffix();
     if ($suffix && '/' != $suffix) {
         $pathInfo = str_replace($suffix, '', $pathInfo);
     }
     $pathInfo = explode('/', trim($pathInfo, '/ '), 2);
     $identifier = $pathInfo[0];
     $params = isset($pathInfo[1]) ? $pathInfo[1] : '';
     /* @var $page Amasty_Xlanding_Model_Page */
     $page = Mage::getModel('amlanding/page');
     $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());
     if (!$pageId) {
         return false;
     }
     $params = trim($params, '/ ');
     if ($params) {
         $params = explode('/', $params);
         Mage::register('amshopby_current_params', $params);
     }
     $request->setModuleName('amlanding')->setControllerName('page')->setActionName('view')->setParam('page_id', $pageId)->setParam('am_landing', $identifier);
     return true;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:34,代码来源:Router.php


示例7: preDispatch

 /**
  * Called before an action is dispatched by Zend_Controller_Dispatcher.
  *
  * This callback allows for proxy or filter behavior.  The
  * $action must be returned for the Zend_Controller_Dispatcher_Token to be dispatched.
  * To abort the dispatch, return FALSE.
  *
  * @param  Zend_Controller_Request_Http $action
  * @return Zend_Controller_Dispatcher_Token|boolean
  */
 public function preDispatch($action)
 {
     $module = $action->getModuleName();
     $definition = null;
     if (isset($this->config[$module])) {
         $definition = $this->config[$module];
     } else {
         if (isset($this->config['master_layout'])) {
             $definition = $this->config['master_layout'];
         }
     }
     if ($definition != null && !$action->getParam('__ignorelayout')) {
         $view = null;
         $layoutName = $this->getViewNameFrom($definition, strtolower($action->getControllerName()), strtolower($action->getActionName()));
         if ($layoutName) {
             $view = new MasterView($layoutName, $this->config['layout_path']);
         }
         if ($view != null) {
             Zend_Registry::set('MasterView', $view);
             $baseView = Zend_Registry::get(NovemberApplication::$ZEND_VIEW);
             $baseView->setMaster('MasterView');
         }
     }
     return $action;
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:35,代码来源:LayoutPlugin.php


示例8: _addHomepageRoute

 /**
  * Adds the homepage route to the router (as specified by the navigation settings page)
  * The route will not be added if the user is currently on the admin theme.
  *
  * @param Zend_Controller_Router_Rewrite $router The router
  */
 private function _addHomepageRoute($router)
 {
     // Don't add the route if the user is on the admin theme
     if (is_admin_theme()) {
         return;
     }
     $homepageUri = trim(get_option(Omeka_Form_Navigation::HOMEPAGE_URI_OPTION_NAME));
     if (strpos($homepageUri, ADMIN_BASE_URL) === 0) {
         // homepage uri is an admin link
         $this->_addHomepageRedirect($homepageUri, $router);
     } else {
         if (strpos($homepageUri, '?') === false) {
             // left trim root directory off of the homepage uri
             $relativeUri = $this->_leftTrim($homepageUri, PUBLIC_BASE_URL);
             // make sure the new homepage is not the default homepage
             if ($relativeUri == '' || $relativeUri == '/') {
                 return;
             }
             $homepageRequest = new Zend_Controller_Request_Http();
             $homepageRequest->setRequestUri($homepageUri);
             $router->route($homepageRequest);
             $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
             if ($dispatcher->isDispatchable($homepageRequest)) {
                 // homepage is an internal link
                 $router->addRoute(self::HOMEPAGE_ROUTE_NAME, new Zend_Controller_Router_Route('/', $homepageRequest->getParams()));
                 return;
             }
         }
     }
     // homepage is some external link, a broken internal link, or has a
     // query string
     $this->_addHomepageRedirect($homepageUri, $router);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:39,代码来源:Router.php


示例9: match

 /**
  * match the route
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     //if magento is not installed redirect to install
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     //get the url key
     $urlKey = trim($request->getPathInfo(), '/');
     //explode by slash
     $parts = explode('/', $urlKey);
     //if there are not 2 parts (tag/something) in the url we don't care about it.
     //return false and let the rest of the application take care of the url.
     if (count($parts) != 2) {
         return false;
     }
     //if the first part of the url key is not 'tag' we don't care about it
     //return false and let the rest of the application take care of the url
     if ($parts[0] != 'tag') {
         return false;
     }
     $tagName = urldecode($parts[1]);
     //tag name
     //load the tag model
     $tag = Mage::getModel('tag/tag')->loadByName($tagName);
     //if there is no tag with this name available in the current store just do nothing
     if (!$tag->getId() || !$tag->isAvailableInStore()) {
         return false;
     }
     //but if the tag is valid
     //say to magento that the request should be mapped to `tag/product/list/tagId/ID_HERE` - the original url
     $request->setModuleName('tag')->setControllerName('product')->setActionName('list')->setParam('tagId', $tag->getId());
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $urlKey);
     return true;
 }
开发者ID:xiaoguizhidao,项目名称:EasylifeTag,代码行数:40,代码来源:Router.php


示例10: myUrl

    /**

     * Return the URL

     *

     * @param string|array $urlOptions

     * @param string       $name

     * @param bool         $reset

     * @param bool         $encode

     * @return string

     */
    public function myUrl($urlOptions = array(), $name = null, $reset = false, $encode = true)
    {
        $front = Zend_Controller_Front::getInstance();
        $router = $front->getRouter();
        $extraUrlOptions = array();
        $extraOptions = Zend_Controller_Front::getInstance()->getRequest()->getParams();
        if (count($extraOptions)) {
            foreach ($extraOptions as $key => $value) {
                if ($key != 'module' && $key != 'controller' && $key != 'action') {
                    $extraUrlOptions[] = $key . '=' . ($encode ? urlencode($value) : $value);
                }
            }
        }
        if (is_string($urlOptions)) {
            $urlOptions = '/' . ltrim($urlOptions, '/');
            // Case the first character is ?
            $request = new Zend_Controller_Request_Http();
            // Creates a cleaned instance of request http
开发者ID:agenciaaeh,项目名称:kahina,代码行数:35,代码来源:MyUrl.php


示例11: nopageAction

 public function nopageAction()
 {
     $http = new Zend_Controller_Request_Http();
     if ($http->isXmlHttpRequest()) {
         $this->view->noLayout = true;
     }
 }
开发者ID:sandin,项目名称:iMemo,代码行数:7,代码来源:ErrorController.php


示例12: match

 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::app()->isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $pathInfo = trim($request->getPathInfo(), '/');
     //echo $pathInfo;die();
     $pathInfoAr = explode('/', $pathInfo);
     if ($pathInfoAr[0] == Mage::getStoreConfig('vc_miniblog/blog/router')) {
         if (isset($pathInfoAr[1])) {
             switch ($pathInfoAr[1]) {
                 case 'tag':
                     $request->setModuleName('vc_miniblog')->setControllerName('index')->setActionName('index');
                     $request->setParams(array('tag' => $pathInfoAr[2]));
                     $request->setParams(array('tag' => $pathInfoAr[2]));
                     break;
                 case 'cat':
                     $request->setModuleName('vc_miniblog')->setControllerName('index')->setActionName('index');
                     $request->setParams(array('cat' => $pathInfoAr[2]));
                     break;
                 default:
                     $request->setModuleName('vc_miniblog')->setControllerName('index')->setActionName('postDetail');
                     $request->setParams(array('identifier' => $pathInfoAr[1]));
                     break;
             }
         } else {
             $request->setModuleName('vc_miniblog')->setControllerName('index')->setActionName('index');
         }
         return true;
     }
     return false;
 }
开发者ID:hoadaithieu,项目名称:mage-miniblog,代码行数:33,代码来源:Router.php


示例13: match

 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::app()->isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $route = "f";
     $identifier = $request->getPathInfo();
     if (substr(str_replace("/", "", $identifier), 0, strlen($route)) != $route) {
         return false;
     }
     $identifier = substr_replace($request->getPathInfo(), '', 0, strlen("/" . $route . "/"));
     $identifier = str_replace('.html', '', $identifier);
     $identifier = str_replace('.htm', '', $identifier);
     $identifier = str_replace('.php', '', $identifier);
     if ($identifier[strlen($identifier) - 1] == "/") {
         $identifier = substr($identifier, '', -1);
     }
     $identifier = explode('/', $identifier, 3);
     if (isset($identifier[1]) && isset($identifier[0]) && !isset($identifier[2])) {
         $request->setModuleName('f')->setControllerName('index')->setActionName('view')->setParam('id', $identifier[0])->setParam('v', $identifier[1]);
         return true;
     } else {
         return false;
     }
 }
开发者ID:FranchuCorraliza,项目名称:magento,代码行数:26,代码来源:Router.php


示例14: __construct

 public function __construct($args = false)
 {
     if ($args === false) {
         // Created with _getProcessor function
         $registryKey = '_singleton/amfpc/fpc_front';
         Mage::register($registryKey, $this, true);
     }
     if (isset($_SESSION)) {
         $this->_sessionName = session_name();
     } else {
         $sessionName = (string) Mage::app()->getConfig()->getNode('global/amfpc/session_name');
         if ($sessionName) {
             $this->_sessionName = $sessionName;
         }
     }
     $request = new Zend_Controller_Request_Http();
     $pathInfo = trim(strtok($request->getRequestUri(), '?'), '/');
     if ($this->getDbConfig('web/url/use_store')) {
         $pathParts = explode('/', $pathInfo);
         $storeCode = array_shift($pathParts);
         $this->_urlInfo = array('store_code' => $storeCode, 'page' => implode('/', $pathParts));
     } else {
         $this->_urlInfo = array('store_code' => false, 'page' => $pathInfo);
     }
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:25,代码来源:Front.php


示例15: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $front = Zend_Controller_Front::getInstance();
     // Front controller has error handler plugin
     // if the request is an error request.
     // If the error handler plugin is not registered,
     // we will be unable which MCA to run, so do not continue.
     $errorHandlerClass = 'Zend_Controller_Plugin_ErrorHandler';
     if (!$front->hasPlugin($errorHandlerClass)) {
         return false;
     }
     // Determine new error controller module_ErrorController_ErrorAction
     $plugin = $front->getPlugin($errorHandlerClass);
     $errorController = $plugin->getErrorHandlerController();
     $errorAaction = $plugin->getErrorHandlerAction();
     $module = $request->getModuleName();
     // Create test request module_ErrorController_ErrorAction...
     $testRequest = new Zend_Controller_Request_Http();
     $testRequest->setModuleName($module)->setControllerName($errorController)->setActionName($errorAaction);
     // Set new error controller if available
     if ($front->getDispatcher()->isDispatchable($testRequest)) {
         $plugin->setErrorHandlerModule($module);
     } else {
         return false;
     }
     return true;
 }
开发者ID:massimozappino,项目名称:zmz,代码行数:27,代码来源:ErrorHandler.php


示例16: match

 /**
  *  See if any product matches
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     // Clear session to make sure users can add products and the shopping cart clears properly
     if (isset($_GET['zipcode'])) {
         Mage::helper('urls')->clearSession($_GET['zipcode']);
     }
     // Get basic data
     $identifier = urldecode(strtolower(trim($request->getPathInfo(), '/')));
     $vendorsCollection = Mage::helper('urls')->getVendors();
     $vendorId = false;
     $productSlug = '';
     // Get vendor id
     $vendorId = $this->_detectVendorId($identifier, $vendorsCollection);
     // Get product slug
     preg_match('/.*\\/(.*).html$/', $identifier, $matches);
     $productSlug = $matches[1];
     if ($vendorId) {
         Mage::register('vendorId', $vendorId);
         $productId = Mage::helper('urls')->getProductIdBySlug($productSlug, $vendorId);
         if ('' == $productId || empty($productId)) {
             return false;
         }
         // Point to correct product
         $request->setModuleName('catalog')->setControllerName('product')->setActionName('view')->setParam('id', $productId);
         return true;
     }
     return false;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:38,代码来源:Router.php


示例17: match

 public function match(Zend_Controller_Request_Http $request)
 {
     $active = Mage::getStoreConfig("dev/offline/mwdevtoolbar");
     if ($active == 1) {
         $storeenabled = Mage::getStoreConfig('dev/offline/enable', $request->getStoreCodeFromPath());
         if ($storeenabled) {
             Mage::getSingleton('core/session', array('name' => 'adminhtml'));
             $helper = Mage::helper('developertoolbar/data');
             if ($helper->checkAllowsIps() == 0) {
                 Mage::getSingleton('core/session', array('name' => 'front'));
                 $front = $this->getFront();
                 $response = $front->getResponse();
                 $response->setHeader('HTTP/1.1', '503 Service Temporarily Unavailable');
                 $response->setHeader('Status', '503 Service Temporarily Unavailable');
                 $response->setHeader('Retry-After', '5000');
                 $response->setBody(html_entity_decode(Mage::getStoreConfig('dev/offline/message', $request->getStoreCodeFromPath()), ENT_QUOTES, "utf-8"));
                 $response->sendHeaders();
                 $response->outputBody();
                 exit;
             } else {
                 $showreminder = Mage::getStoreConfig('dev/offline/reminder', $request->getStoreCodeFromPath());
                 if ($showreminder) {
                     $front = $this->getFront();
                     $response = $front->getResponse()->clearBody();
                     $response = $front->getResponse()->appendBody('<div style="height:12px; background:red; color: white; position:relative; width:100%;padding:3px; z-index:100000;text-trasform:capitalize;">Offline</div>');
                 }
             }
         }
     }
     return parent::match($request);
 }
开发者ID:ujwalasawant,项目名称:magento,代码行数:31,代码来源:Standard.php


示例18: setUp

    public function setUp()
    {
        $savePath = ini_get('session.save_path');
        if (strpos($savePath, ';')) {
            $savePath = explode(';', $savePath);
            $savePath = array_pop($savePath);
        }
        if (empty($savePath)) {
            $this->markTestSkipped('Cannot test FlashMessenger due to unavailable session save path');
        }

        if (headers_sent()) {
            $this->markTestSkipped('Cannot test FlashMessenger: cannot start session because headers already sent');
        }
        Zend_Session::start();

        $this->front      = Zend_Controller_Front::getInstance();
        $this->front->resetInstance();
        $this->front->setControllerDirectory(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . '_files');
        $this->front->returnResponse(true);
        $this->request    = new Zend_Controller_Request_Http();
        $this->request->setControllerName('helper-flash-messenger');
        $this->response   = new Zend_Controller_Response_Cli();
        $this->controller = new HelperFlashMessengerController($this->request, $this->response, array());
        $this->helper     = new Zend_Controller_Action_Helper_FlashMessenger($this->controller);
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:26,代码来源:FlashMessengerTest.php


示例19: _initStoreRoutes

 protected function _initStoreRoutes()
 {
     $request = new Zend_Controller_Request_Http();
     $path = explode('/', trim($request->getPathInfo(), '/'));
     $requestedPath = array_shift($path);
     $requestedHost = $request->getHttpHost();
     if ($store = Cosmos_Api::get()->cosmos->getStoreByHostPath($requestedHost, $requestedPath)) {
         $this->bootstrap('session');
         Zend_Registry::set('csession', new Zend_Session_Namespace("cosmos_{$store['group_id']}"));
         Zend_Registry::get('log')->info($store);
         if ($store['path']) {
             $this->bootstrap('frontcontroller');
             $front = Zend_Controller_Front::getInstance();
             $request = $front->getRequest();
             $dispatcher = $front->getDispatcher();
             $defaultRoute = new Zend_Controller_Router_Route_Module(array(), $dispatcher, $request);
             $front->getRouter()->removeDefaultRoutes();
             $defaults = array('path' => $store['path'], 'module' => $dispatcher->getDefaultModule());
             $pathRoute = new Zend_Controller_Router_Route(':path', $defaults);
             Zend_Registry::set('cosmosRoute', $pathRoute);
             // This is to catch empty requests because for some reason 'default' doesn't.
             $front->getRouter()->addRoute('default-empty', $pathRoute);
             $front->getRouter()->addRoute('default', $pathRoute->chain($defaultRoute));
             Zend_Registry::set('mode', 'path');
         } else {
             Zend_Registry::set('mode', 'host');
         }
     } else {
         die('fail');
         // no matching store?
     }
     Cosmos_Addon::getInstance($store['addons']);
 }
开发者ID:EvanDotPro,项目名称:cosmos,代码行数:33,代码来源:ClientBootstrap.php


示例20: match

 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $parts = explode('/', $identifier);
     if (isset($parts[1]) && $parts[1] == 'reviews') {
         $product = Mage::getModel('catalog/product')->loadByAttribute('url_key', $parts[0]);
         if (isset($parts[2])) {
             $p = explode('-', $parts[2]);
             $id = (int) end($p);
             $request->setRouteName('review')->setModuleName('review')->setControllerName('product')->setActionName('view')->setParam('id', $id)->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'reviews');
             return true;
         } else {
             if ($product) {
                 $request->setRouteName('review')->setModuleName('review')->setControllerName('product')->setActionName('list')->setParam('id', $product->getId())->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'reviews');
                 return true;
             }
         }
     } elseif ($parts[0] == 'tag' && isset($parts[1])) {
         $p = explode('-', $parts[1]);
         $id = (int) end($p);
         $request->setRouteName('tag')->setModuleName('tag')->setControllerName('product')->setActionName('list')->setParam('tagId', $id)->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 'tags');
         return true;
     }
     return false;
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:29,代码来源:Router.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Controller_Response_Http类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Controller_Request_Abstract类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap