magento中event和template里面如何跳转?

1
2
3
4
5
6
7
8
9
10
11
12
public function prepareCategoryViewAfter(Varien_Event_Observer $observer)
{
$event = $observer->getEvent();
$category = $event->getCategory();
if($category->getId() == 23){
Mage::app()->getFrontController()->getResponse()
->setRedirect(Mage::getBaseUrl())
->sendResponse();
exit;
}
return $this;
}

 

坚持原创技术分享,您的支持将鼓励我继续创作!