src/ShopBundle/objects/TShopCategoryTree/TShopCategoryTree.class.php
public function Render($sListFilterItemId = false, $bHideEmptyCategories = false, $bShowArticleCount = false, $iLevelCount = 1)
    {
        $sHtml = '';
        $sCategoryNameHtml = '';
        if (!is_null($this->oRealCategory)) {
            $sCategoryNameHtml = $this->RenderCategoryName($sListFilterItemId, $bShowArticleCount, $iLevelCount);
        }
        $sChildCategoriesHtml = $this->RenderChildCategories($sListFilterItemId, $bHideEmptyCategories, $bShowArticleCount, $iLevelCount + 1);
        if (empty($sChildCategoriesHtml) && 0 == $this->iAllItemCount && $bHideEmptyCategories) {
            $sHtml = '';
        } else {
            if (!is_null($this->oRealCategory)) {
                $aClass = array('CategoryLevel_'.$iLevelCount);
                if (!empty($sChildCategoriesHtml)) {
                    $aClass[] = 'hasChildren';
                } else {
                    $aClass[] = 'isLeaflet';
                }
                if ($this->bIsActive) {
                    $aClass[] = 'active expanded';
                }
                $sHtml .= '<ul>';
                $sHtml .= '<li class="'.implode(' ', $aClass).'">'.$sCategoryNameHtml;
            }
            $sHtml .= $sChildCategoriesHtml;
            if (!is_null($this->oRealCategory)) {
                $sHtml .= '</li>';
                $sHtml .= '</ul>';
            }
        }

        return $sHtml;
    }
public function Render($sListFilterItemId = false, $bHideEmptyCategories = false, $bShowArticleCount = false, $iLevelCount = 1)
    {
        $sHtml = '';
        $sCategoryNameHtml = '';
        if (!is_null($this->oRealCategory)) {
            $sCategoryNameHtml = $this->RenderCategoryName($sListFilterItemId, $bShowArticleCount, $iLevelCount);
        }
        $sChildCategoriesHtml = $this->RenderChildCategories($sListFilterItemId, $bHideEmptyCategories, $bShowArticleCount, $iLevelCount + 1);
        if (empty($sChildCategoriesHtml) && 0 == $this->iAllItemCount && $bHideEmptyCategories) {
            $sHtml = '';
        } else {
            if (!is_null($this->oRealCategory)) {
                $aClass = array('CategoryLevel_'.$iLevelCount);
                if (!empty($sChildCategoriesHtml)) {
                    $aClass[] = 'hasChildren';
                } else {
                    $aClass[] = 'isLeaflet';
                }
                if ($this->bIsActive) {
                    $aClass[] = 'active expanded';
                }
                $sHtml .= '<ul>';
                $sHtml .= '<li class="'.implode(' ', $aClass).'">'.$sCategoryNameHtml;
            }
            $sHtml .= $sChildCategoriesHtml;
            if (!is_null($this->oRealCategory)) {
                $sHtml .= '</li>';
                $sHtml .= '</ul>';
            }
        }

        return $sHtml;
    }
public function Render ( $ sListFilterItemId = false , $ bHideEmptyCategories = false , $ bShowArticleCount = false , $ iLevelCount = 1 ) { $ sHtml = '' ; $ sCategoryNameHtml = '' ; if ( ! is_null ( $ this -> oRealCategory ) ) { $ sCategoryNameHtml = $ this -> RenderCategoryName ( $ sListFilterItemId , $ bShowArticleCount , $ iLevelCount ) ; } $ sChildCategoriesHtml = $ this -> RenderChildCategories ( $ sListFilterItemId , $ bHideEmptyCategories , $ bShowArticleCount , $ iLevelCount + 1 ) ; if ( empty ( $ sChildCategoriesHtml ) && 0 == $ this -> iAllItemCount && $ bHideEmptyCategories ) { $ sHtml = '' ; } else { if ( ! is_null ( $ this -> oRealCategory ) ) { $ aClass = array ( 'CategoryLevel_' . $ iLevelCount ) ; if ( ! empty ( $ sChildCategoriesHtml ) ) { $ aClass [ ] = 'hasChildren' ; } else { $ aClass [ ] = 'isLeaflet' ; } if ( $ this -> bIsActive ) { $ aClass [ ] = 'active expanded' ; } $ sHtml .= '<ul>' ; $ sHtml .= '<li class="' . implode ( ' ' , $ aClass ) . '">' . $ sCategoryNameHtml ; } $ sHtml .= $ sChildCategoriesHtml ; if ( ! is_null ( $ this -> oRealCategory ) ) { $ sHtml .= '</li>' ; $ sHtml .= '</ul>' ; } } return $ sHtml ; }
Renders the category tree.
Function not uses external views. Html was rendered in class for better performance.
If you want to change something on the html overwrite one of the render functions.

@param bool $sListFilterItemId
@param bool $bHideEmptyCategories
@param bool $bShowArticleCount
@param int  $iLevelCount

@return string
Renders the category tree . Function not uses external views . Html was rendered in class for better performance . If you want to change something on the html overwrite one of the render functions .