本文整理汇总了PHP中Varien_Data_Tree_Node::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Tree_Node::getUrl方法的具体用法?PHP Varien_Data_Tree_Node::getUrl怎么用?PHP Varien_Data_Tree_Node::getUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Tree_Node
的用法示例。
在下文中一共展示了Varien_Data_Tree_Node::getUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _drawTwoLevelMenu
/**
* @param Varien_Data_Tree_Node $menuTree
* @return string
*/
protected function _drawTwoLevelMenu(Varien_Data_Tree_Node $menuTree)
{
$children = $menuTree->getChildren();
$html = '<li>';
$html .= '<a href="' . $menuTree->getUrl() . '"><span>' . $this->escapeHtml($menuTree->getName()) . '</span></a>';
$html .= '<div class="drop"><div class="drop-holder"><div class="col-frame"><div class="col-holder">';
$index = 1;
foreach ($children as $child) {
$html .= '<div class="col">';
$html .= '<strong class="title-drop">' . $this->escapeHtml($child->getName()) . '</strong><ul>';
$secondLevelChildren = $child->getChildren();
$childrenCount = $secondLevelChildren->count();
$key = 0;
foreach ($secondLevelChildren as $ch) {
if ($key == 5) {
break;
}
$html .= '<li><a href="' . $ch->getUrl() . '">' . $this->escapeHtml($ch->getName()) . '</a></li>';
$key++;
}
$html .= '</ul>';
if ($childrenCount > 5 || $childrenCount == 0) {
$html .= '<a class="all-links" href="' . $child->getUrl() . '">All ' . $this->escapeHtml($child->getName()) . '</a>';
}
$html .= '</div>';
if ($index % 3 == 0 && $index > 0) {
$html .= '</div><div class="col-holder">';
}
$index++;
}
$html .= '</div></div></div></div>';
$html .= '</li>';
return $html;
}
示例2: _getMenuItemClasses
protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
{
$classes = array();
$classes[] = 'level' . $item->getLevel();
$classes[] = $item->getPositionClass();
if ($item->getIsFirst()) {
$classes[] = 'first';
}
if ($item->getIsActive()) {
$classes[] = 'active';
}
if (Mage::helper('core/url')->getCurrentUrl() == str_replace(Mage::helper('catalog/product')->getProductUrlSuffix(), "", $item->getUrl())) {
$classes[] = 'custom-active';
}
if ($item->getIsLast()) {
$classes[] = 'last';
}
if ($item->getClass()) {
$classes[] = $item->getClass();
}
if ($item->hasChildren()) {
$classes[] = 'parent';
}
return $classes;
}
示例3: _formatItemUrl
/**
* Format item url
*
* @param Varien_Data_Tree_Node $item
*/
protected function _formatItemUrl(Varien_Data_Tree_Node $item)
{
if ($item->getUrlType() == 1) {
if (!($itemFullUrl = $item->getFullUrl()) && ($itemUrl = $item->getUrl())) {
if (strpos($itemUrl, '://') === false) {
$itemUrl = $this->_getUrlModel()->getDirectUrl($itemUrl != '/' ? $itemUrl : '');
}
$item->setFullUrl($itemUrl);
}
} else {
$url = Mage::Helper('cms/page')->getPageUrl($item->getCmsPageIdentifier());
$item->setFullUrl($url);
}
}
示例4: _formatItemUrl
/**
* Format item url
*
* @param Varien_Data_Tree_Node $item
*/
protected function _formatItemUrl(Varien_Data_Tree_Node $item)
{
if (!($itemFullUrl = $item->getFullUrl()) && ($itemUrl = $item->getUrl())) {
if (strpos($itemUrl, '://') === false) {
$itemUrl = $this->_getUrlModel()->getDirectUrl($itemUrl != '/' ? $itemUrl : '');
}
$item->setFullUrl($itemUrl);
}
}