Skip to main content

Offcanvas

Helper for rendering offcanvas


Constants

ConstantVisibilityTypeValue
PLACEMENT_STARTpublic'start'
PLACEMENT_ENDpublic'end'
PLACEMENT_TOPpublic'top'
PLACEMENT_BOTTOMpublic'bottom'

Properties

allowedPlacements

protected static $allowedPlacements
  • This property is static.

allowedOptions

protected static $allowedOptions
  • This property is static.

Methods

__invoke

Generates an 'offcanvas' element

public __invoke(string $content, iterable $optionsAndAttributes = [], bool $escape = true): string

Parameters:

ParameterTypeDescription
$contentstringThe content of the offcanvas body
$optionsAndAttributesiterableHtml attributes of the offcanvas "container"
$escapeboolTrue espace html content '$content'. Default True

Return Value:

The offcanvas XHTML.


renderHeader

protected renderHeader(iterable $headerOptions, bool $escape): string

Parameters:

ParameterTypeDescription
$headerOptionsiterable
$escapebool

renderTriggers

protected renderTriggers(iterable $triggers, ?string $id = null): string

Parameters:

ParameterTypeDescription
$triggersiterable
$id?string

renderTrigger

protected renderTrigger(iterable $trigger, ?string $id = null): string

Parameters:

ParameterTypeDescription
$triggeriterable
$id?string

renderBody

protected renderBody(string $content, \TwbsHelper\View\HtmlAttributesSet $attributes, bool $escape): string

Parameters:

ParameterTypeDescription
$contentstring
$attributes\TwbsHelper\View\HtmlAttributesSet
$escapebool

renderContainer

protected renderContainer(string $content, iterable $optionsAndAttributes, bool $escape): string

Parameters:

ParameterTypeDescription
$contentstring
$optionsAndAttributesiterable
$escapebool