DirectTreeRenderer::setEntryTemplate()

DirectTreeRenderer::setEntryTemplate() – メニューエントリのテンプレートを設定する

Synopsis

require_once 'HTML/Menu/DirectTreeRenderer.php';

void HTML_Menu_DirectTreeRenderer::setEntryTemplate ( mixed $type , string $template = = null )

Description

テンプレートには、最低ひとつの {title} プレースホルダが必須です。 また {url} プレースホルダを指定することも可能です。 デフォルトのテンプレートは次のようになります。

<?php
array(
    
HTML_MENU_ENTRY_INACTIVE    => '<a href="{url}">{title}</a>',
    
HTML_MENU_ENTRY_ACTIVE      => '<strong>{title}</strong>',
    
HTML_MENU_ENTRY_ACTIVEPATH  => '<a href="{url}"><em>{title}</em></a>'
);
?>

独自のキーがメニュー構造内に存在する場合、 それらは対応するプレースホルダに代入されます。

Parameter

mixed $type

型 (HTML_MENU_ENTRY_* 定数 のいずれか) あるいは 'type' => 'template' 形式の配列。

string $template

$type が配列でない場合の、このエントリ型のテンプレート。

Throws

例外はスローされません。

Note

This function can not be called statically.