本文整理汇总了PHP中Mage_Core_Controller_Request_Http::setAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Request_Http::setAlias方法的具体用法?PHP Mage_Core_Controller_Request_Http::setAlias怎么用?PHP Mage_Core_Controller_Request_Http::setAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Request_Http
的用法示例。
在下文中一共展示了Mage_Core_Controller_Request_Http::setAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: match
/**
* Validate and Match Cms Page and modify request
*
* @param Mage_Core_Controller_Request_Http $request
* @return bool
*
* @SuppressWarnings(PHPMD.ExitExpression)
*/
public function match(Mage_Core_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));
$this->_eventManager->dispatch('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 $this->_controllerFactory->createController('Mage_Core_Controller_Varien_Action_Redirect', array('request' => $request));
}
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 $this->_controllerFactory->createController('Mage_Core_Controller_Varien_Action_Forward', array('request' => $request));
}
示例2: _matchControllerName
/**
* Match controller name
*
* @param Mage_Core_Controller_Request_Http $request
* @param string $param
* @return string
*/
protected function _matchControllerName(Mage_Core_Controller_Request_Http $request, $param)
{
if ($request->getControllerName()) {
$controller = $request->getControllerName();
} else {
if (!empty($param)) {
$controller = $param;
} else {
$controller = $this->getFront()->getDefault('controller');
$request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, ltrim($request->getOriginalPathInfo(), '/'));
}
}
return $controller;
}