Skip to main content

Navbar

Helper for rendering navbar


  • Full name: \TwbsHelper\View\Helper\Navigation\Navbar
  • Parent class: AbstractHelper

Constants

ConstantVisibilityTypeValue
BRAND_POSITION_LEFTpublic'left'
BRAND_POSITION_RIGHTpublic'right'
BRAND_POSITION_HIDDENpublic'hidden'

Methods

__invoke

View helper entry point.

public __invoke(\Laminas\Navigation\AbstractContainer $container = null): self|string

Retrieves helper and optionally sets container to operate on.

Parameters:

ParameterTypeDescription
$container\Laminas\Navigation\AbstractContainer[optional] container to operate on

render

Renders navbar.

public render(\Laminas\Navigation\AbstractContainer $container = null, array $options = []): string

Implements

  • See: .

Parameters:

ParameterTypeDescription
$container\Laminas\Navigation\AbstractContainer[optional] container to render. Default is
to render the container registered in the helper.
$optionsarray[optional] options for controlling rendering

See Also:

  • \TwbsHelper\View\Helper\Navigation\renderNavbar()

renderNavbar

Renders helper.

public renderNavbar(\Laminas\Navigation\AbstractContainer $container = null, array $options = []): string

Renders a HTML 'ul' for the given $container. If $container is not given, the container registered in the helper will be used.

Available $options:

Parameters:

ParameterTypeDescription
$container\Laminas\Navigation\AbstractContainer[optional] container to create menu from.
Default is to use the container retrieved from {@link getContainer()}.
$optionsarray[optional] options for controlling rendering

prepareAttributes

protected prepareAttributes(iterable $options): \TwbsHelper\View\HtmlAttributesSet

Parameters:

ParameterTypeDescription
$optionsiterable

renderToggler

public renderToggler(iterable $options, ?string $id = null): string

Parameters:

ParameterTypeDescription
$optionsiterable
$id?string

renderBrand

public renderBrand(mixed $brandOptions): string

Parameters:

ParameterTypeDescription
$brandOptionsmixed

renderText

public renderText(mixed $textOptions): string

Parameters:

ParameterTypeDescription
$textOptionsmixed

renderNavbarNav

public renderNavbarNav(string $content, \Laminas\Navigation\AbstractContainer $container, iterable $options, ?string $id = null, ?string $brandContent = null): string

Parameters:

ParameterTypeDescription
$contentstring
$container\Laminas\Navigation\AbstractContainer
$optionsiterable
$id?string
$brandContent?string

renderNav

public renderNav(\Laminas\Navigation\AbstractContainer $container, array $navOptions = []): string

Parameters:

ParameterTypeDescription
$container\Laminas\Navigation\AbstractContainer
$navOptionsarray

renderOffcanvas

public renderOffcanvas(string $content, iterable $options, ?string $id = null): string

Parameters:

ParameterTypeDescription
$contentstring
$optionsiterable
$id?string

renderCollapse

public renderCollapse(string $content, ?string $id = null): string

Parameters:

ParameterTypeDescription
$contentstring
$id?string

renderForm

public renderForm(mixed $form): string

Parameters:

ParameterTypeDescription
$formmixed

renderContainer

protected renderContainer(string $content, mixed $containerOption): string

Parameters:

ParameterTypeDescription
$contentstring
$containerOptionmixed

normalizeId

Normalize an ID

protected normalizeId(string $value): string

Overrides

  • See: .

Parameters:

ParameterTypeDescription
$valuestring