Public Member Functions | |
initControllerRouters ($observer) | |
match (Zend_Controller_Request_Http $request) |
Definition at line 27 of file Router.php.
initControllerRouters | ( | $ | observer | ) |
Definition at line 29 of file Router.php.
00030 { 00031 $front = $observer->getEvent()->getFront(); 00032 00033 $cms = new Mage_Cms_Controller_Router(); 00034 $front->addRouter('cms', $cms); 00035 }
match | ( | Zend_Controller_Request_Http $ | request | ) |
Reimplemented from Mage_Core_Controller_Varien_Router_Abstract.
Definition at line 37 of file Router.php.
00038 { 00039 if (!Mage::isInstalled()) { 00040 Mage::app()->getFrontController()->getResponse() 00041 ->setRedirect(Mage::getUrl('install')) 00042 ->sendResponse(); 00043 exit; 00044 } 00045 00046 $identifier = trim($request->getPathInfo(), '/'); 00047 00048 $page = Mage::getModel('cms/page'); 00049 $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId()); 00050 if (!$pageId) { 00051 return false; 00052 } 00053 00054 $request->setModuleName(isset($d[0]) ? $d[0] : 'cms') 00055 ->setControllerName(isset($d[1]) ? $d[1] : 'page') 00056 ->setActionName(isset($d[2]) ? $d[2] : 'view') 00057 ->setParam('page_id', $pageId); 00058 $request->setAlias( 00059 Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, 00060 $identifier 00061 ); 00062 return true; 00063 }