本文整理汇总了PHP中Mage_Core_Controller_Request_Http::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Request_Http::getAlias方法的具体用法?PHP Mage_Core_Controller_Request_Http::getAlias怎么用?PHP Mage_Core_Controller_Request_Http::getAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Request_Http
的用法示例。
在下文中一共展示了Mage_Core_Controller_Request_Http::getAlias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initProperties
/**
* @param Varien_Event_Observer $observer
*/
protected function _initProperties(Varien_Event_Observer $observer)
{
$this->_controller = $observer->getEvent()->getControllerAction();
$this->_request = $this->_controller->getRequest();
$this->_response = $this->_controller->getResponse();
$this->_pageIdentifier = $this->_request->getAlias('rewrite_request_path');
}
示例2: getCurrentUnSecureUrl
/**
*
* @param Mage_Core_Controller_Request_Http $request
* @return string
*/
public function getCurrentUnSecureUrl($request)
{
if ($alias = $request->getAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS)) {
return Mage::getBaseUrl('link', false) . ltrim($alias, '/');
}
return Mage::getBaseUrl('link', false) . ltrim($request->getPathInfo(), '/');
}
示例3: _applyCustomMaxAgeFromDb
/**
* Apply custom Cache-Control: max-age from db
*
* @param Mage_Core_Controller_Request_Http $request
* @param Mage_Core_Controller_Response_Http $response
*/
protected function _applyCustomMaxAgeFromDb(Mage_Core_Controller_Request_Http $request, Mage_Core_Controller_Response_Http $response)
{
if (!$this->messagesToShow) {
// apply custom max-age from db
$urls = array($request->getRequestString());
$alias = $request->getAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS);
if ($alias) {
$urls[] = $alias;
}
/** @var $customUrlModel Aoe_Static_Model_CustomUrl */
$customUrlModel = Mage::getModel('aoestatic/customUrl');
$customUrlModel->setStoreId(Mage::app()->getStore()->getId());
$customUrlModel->loadByRequestPath($urls);
if ($customUrlModel->getId() && $customUrlModel->getMaxAge()) {
$response->setHeader('Cache-Control', 'max-age=' . (int) $customUrlModel->getMaxAge(), true);
$response->setHeader('X-Magento-Lifetime', (int) $customUrlModel->getMaxAge(), true);
$response->setHeader('aoestatic', 'cache', true);
}
}
}