PEAR Manual
Prev |  | Next

# Class Summary HTML_Menu_SigmaTreeRenderer

Class Summary HTML_Menu_SigmaTreeRenderer -- HTML_Template_Sigma-based renderer for `'tree'` and `'sitemap'` type menus, where menu level is represented by tag nesting.

## Description

The renderer generates outpu similar to that of HTML_Menu_DirectTreeRenderer but offers more possibilites for output customization.

The renderer may also work with HTML_Template_IT instance, but as menu templates tend to have lots of blocks, HTML_Template_Sigma's cache feature will give a significant performance improvement.

## Template structure

This is the minimal template for HTML_Menu_SigmaTreeRenderer, containing all the required blocks:

    <!-- BEGIN mu_tree_loop -->
        <!-- BEGIN mu_level_open -->
    <ul>
        <!-- END mu_level_open -->
            <!-- BEGIN mu_entry_open -->
        <li>
            <!-- END mu_entry_open -->
            <!-- BEGIN mu_active -->
        <strong>{mu_title}</strong>
            <!-- END mu_active -->
            <!-- BEGIN mu_inactive -->
        <a href="{mu_url}">{mu_title}</a>
            <!-- END mu_inactive -->
            <!-- BEGIN mu_activepath -->
        <a href="{mu_url}"><em>{mu_title}</em></a>
            <!-- END mu_activepath -->
            <!-- BEGIN mu_entry_close -->
        </li>
            <!-- END mu_entry_close -->
        <!-- BEGIN mu_level_close -->
    </ul>
        <!-- END mu_level_close -->
    <!-- END mu_tree_loop -->

A more complete example showing possible customizations can be found in the package archive.

Note that blocks and placeholders in the template have `mu_` prefix. This is done to prevent name conflicts with existing blocks and placeholders, `mu_` is the default prefix, another prefix can be passed to class constructor.

Blocks in the template (without prefix)

`tree_loop`

  This block should always be present and should be a parent for all other blocks. It is used to implement "flow", to render entries one after another.

`level_open`, `level_close`

  These blocks will be used on start and end of each menu level. If level-specific blocks `%level%_level_open` and `%level%_level_close` are present, they will be used instead.

`entry_open`, `entry_close`

  These blocks will be used on start and end of each menu entry. If level-specific blocks `%level%_entry_open` and `%level%_entry_close` are present, they will be used instead.

`inactive`, `active`, `activepath`

  These blocks are used to output menu entries, they correspond to possible entry types. Each block should contain a `{title}` placeholder and may also contain `{url}` placeholder. As usual, if other keys are present in original menu array they will be assigned to corresponding placeholders in the template.

  If level-specific block `%level%_%entry type%` exists, it will be used instead.

## Class Trees for HTML_Menu_SigmaTreeRenderer

- HTML_Menu_Renderer

  - HTML_Menu_SigmaTreeRenderer

HTML_Menu_SigmaTreeRenderer Inherited Methods

Table 41-1. Inherited from HTML_Menu_Renderer

Method Name | Summary
--- | ---
HTML_Menu_Renderer::finishLevel() | Finish the tree level (for types `'tree'` and `'sitemap'`)
HTML_Menu_Renderer::finishMenu() | Finish the menu
HTML_Menu_Renderer::finishRow() | Finish the row in the menu
HTML_Menu_Renderer::renderEntry() | Renders the element of the menu
HTML_Menu_Renderer::setMenuType() | Sets the type of the menu being rendered.

Prev | Home | Next
constructor HTML_Menu_SigmaRenderer() | Up | constructor HTML_Menu_SigmaTreeRenderer()