PageHtmlBuilder
PageHtmlBuilder
PageHtmlBuilder provides methods for simple html output in views dependent on the state of the site.
It looks up PageState to determine the current page.
Methods summary
Modifier and Type | Method |
---|---|
public | __construct ( HtmlView view ) |
public PageHtmlBuilderMeta | meta ( ) |
public | title ( string|UiComponent|null overwriteTitle = null ) |
public UiComponent | getTitle ( unknown overwriteTitle = null ) |
public | contentItems ( string panelName ) |
public UiComponent|null | getContentItems ( string panelName ) |
public | navigation ( NavComposer navComposer = null , array attrs = null , array ulAttrs = null , array liAttrs = null , array aAttrs = null ) |
public UiComponent | getNavigation ( NavComposer navComposer = null , array attrs = null , array ulAttrs = null , array liAttrs = null , array aAttrs = null ) |
public | breadcrumbs ( array attrs = null , array liAttrs = null , array aAttrs = null , string divider = null ) |
public UiComponent | getBreadcrumbs ( array attrs = null , array liAttrs = null , array aAttrs = null , unknown divider = null ) |
public | localeSwitch ( array ulAttrs = null , array liAttrs = null , array aAttrs = null ) |
public UiComponent | getN2nLocaleSwitch ( array ulAttrs = null , array liAttrs = null , array aAttrs = null ) |
Methods in detail
-
__construct
-
meta
PageHtmlBuilderMeta public meta ( )return
-
title
public title ( string|UiComponent|null overwriteTitle = null )Prints the html encoded title of the current page or the page name specified in app.ini if there is no current page.param
string|UiComponent|null overwriteTitle prints just passed value if not null -
getTitle
Same as PageHtmlBuilder::title() but returns the output.return
-
contentItems
public contentItems ( string panelName )Prints the content items of the current page which are assigned to the panel with passed name.
<div><?php $pageHtml->contentItems('main') ?></div>
-
getContentItems
UiComponent|null public getContentItems ( string panelName )Same as PageHtmlBuilder::contentItems() but returns the output.return
n2n\web\ui\UiComponent|null -
breadcrumbs
public breadcrumbs ( array attrs = null , array liAttrs = null , array aAttrs = null , string divider = null )Prints a breadcrumb navigation of the current page in form of a ul-/li-list.
Also see PageHtmlBuilderMeta::getBreadcrumbNavBranches() to find out how to build a breadcrumb navigation.
param
array attrs Html attributes of the ul element.array liAttrs Html attributes of each li elementstring divider Pass a UiComponent or string if a divider span element should be printed in each li element. -
getBreadcrumbs
UiComponent public getBreadcrumbs ( array attrs = null , array liAttrs = null , array aAttrs = null , unknown divider = null )Same as PageHtmlBuilder::breadcrumbs() but returns the output.return
-
localeSwitch
public localeSwitch ( array ulAttrs = null , array liAttrs = null , array aAttrs = null )Prints a locale switch navigation of the current page.
Also see PageHtmlBuilderMeta::getN2nLocaleSwitchUrls() to find out how to customize the output.
param
array ulAttrsarray liAttrs -
getN2nLocaleSwitch
UiComponent public getN2nLocaleSwitch ( array ulAttrs = null , array liAttrs = null , array aAttrs = null )Same as PageHtmlBuilder::breadcrumbs() but returns the output.return