本文整理汇总了PHP中AO::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP AO::getURL方法的具体用法?PHP AO::getURL怎么用?PHP AO::getURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AO
的用法示例。
在下文中一共展示了AO::getURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resultAction
public function resultAction()
{
$this->loadLayout();
try {
AO::getSingleton('catalogsearch/advanced')->addFilters($this->getRequest()->getQuery());
} catch (Mage_Core_Exception $e) {
AO::getSingleton('catalogsearch/session')->addError($e->getMessage());
$this->_redirectError(AO::getURL('*/*/'));
}
$this->_initLayoutMessages('catalog/session');
$this->renderLayout();
}
示例2: sendmailAction
public function sendmailAction()
{
$product = $this->_initProduct();
$sendToFriendModel = $this->_initSendToFriendModel();
$data = $this->getRequest()->getPost();
if (!$product || !$product->isVisibleInCatalog() || !$data) {
$this->_forward('noRoute');
return;
}
$categoryId = $this->getRequest()->getParam('cat_id', null);
if ($categoryId && ($category = AO::getModel('catalog/category')->load($categoryId))) {
AO::register('current_category', $category);
}
$sendToFriendModel->setSender($this->getRequest()->getPost('sender'));
$sendToFriendModel->setRecipients($this->getRequest()->getPost('recipients'));
$sendToFriendModel->setIp(AO::getSingleton('log/visitor')->getRemoteAddr());
$sendToFriendModel->setProduct($product);
try {
$validateRes = $sendToFriendModel->validate();
if (true === $validateRes) {
$sendToFriendModel->send();
AO::getSingleton('catalog/session')->addSuccess($this->__('Link to a friend was sent.'));
$this->_redirectSuccess($product->getProductUrl());
return;
} else {
AO::getSingleton('catalog/session')->setFormData($data);
if (is_array($validateRes)) {
foreach ($validateRes as $errorMessage) {
AO::getSingleton('catalog/session')->addError($errorMessage);
}
} else {
AO::getSingleton('catalog/session')->addError($this->__('Some problems with data.'));
}
}
} catch (Mage_Core_Exception $e) {
AO::getSingleton('catalog/session')->addError($e->getMessage());
} catch (Exception $e) {
AO::getSingleton('catalog/session')->addException($e, $this->__('Some emails was not sent'));
}
$this->_redirectError(AO::getURL('*/*/send', array('id' => $product->getId())));
}