Helpers
extends AbstractExtension
in package
Class for use Laminas Helpers: like show/capture head/inline scripts/styles and files.
and others.
Table of Contents
- $basePath : mixed
- $headLink : mixed
- $headMeta : mixed
- $headScript : mixed
- $headStyle : mixed
- $headTitle : mixed
- $inlineScript : mixed
- $request : mixed
- __construct() : mixed
- basePath() : string
- Returns site's base path, or file with base path prepended.
- getFunctions() : mixed
- getName() : mixed
- {@inheritdoc}
- headLink() : HeadLink
- View Helper Method.
- headMeta() : HeadMeta
- Retrieve object instance; optionally add meta tag.
- headScript() : HeadScript
- Return headScript object.
- headStyle() : HeadStyle
- Return headStyle object.
- headTitle() : HeadTitle
- Retrieve placeholder for title element and optionally set state.
- inlineScript() : InlineScript
- Return InlineScript object.
Properties
$basePath
protected
mixed
$basePath
$headLink
protected
mixed
$headLink
$headMeta
protected
mixed
$headMeta
$headScript
protected
mixed
$headScript
$headStyle
protected
mixed
$headStyle
$headTitle
protected
mixed
$headTitle
$inlineScript
protected
mixed
$inlineScript
$request
protected
mixed
$request
Methods
__construct()
public
__construct(Request $request, HeadLink $headLink, HeadMeta $headMeta, HeadScript $headScript, HeadStyle $headStyle, HeadTitle $headTitle, InlineScript $inlineScript) : mixed
Parameters
- $request : Request
- $headLink : HeadLink
- $headMeta : HeadMeta
- $headScript : HeadScript
- $headStyle : HeadStyle
- $headTitle : HeadTitle
- $inlineScript : InlineScript
Return values
mixed —basePath()
Returns site's base path, or file with base path prepended.
public
basePath([string|null $file = null ]) : string
$file is appended to the base path for simplicity.
Parameters
- $file : string|null = null
Return values
string —getFunctions()
public
getFunctions() : mixed
Return values
mixed —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —headLink()
View Helper Method.
public
headLink([array<string|int, mixed> $attributes = null ][, string $placement = Placeholder::APPEND ]) : HeadLink
Parameters
- $attributes : array<string|int, mixed> = null
- $placement : string = Placeholder::APPEND
Return values
HeadLink —headMeta()
Retrieve object instance; optionally add meta tag.
public
headMeta([string $content = null ][, string $keyValue = null ][, string $keyType = 'name' ][, array<string|int, mixed> $modifiers = [] ][, string $placement = Placeholder::APPEND ]) : HeadMeta
Parameters
- $content : string = null
- $keyValue : string = null
- $keyType : string = 'name'
- $modifiers : array<string|int, mixed> = []
- $placement : string = Placeholder::APPEND
Return values
HeadMeta —headScript()
Return headScript object.
public
headScript([string $mode = HeadScript::FILE ][, string $spec = null ][, string $placement = 'APPEND' ][, array<string|int, mixed> $attrs = [] ][, string $type = 'text/javascript' ]) : HeadScript
Parameters
- $mode : string = HeadScript::FILE
-
Script or file
- $spec : string = null
-
Script/url
- $placement : string = 'APPEND'
-
Append, prepend, or set
- $attrs : array<string|int, mixed> = []
-
Array of script attributes
- $type : string = 'text/javascript'
-
Script type and/or array of script attributes
Return values
HeadScript —headStyle()
Return headStyle object.
public
headStyle([string $content = null ][, string $placement = 'APPEND' ][, string|array<string|int, mixed> $attributes = [] ]) : HeadStyle
Parameters
- $content : string = null
-
Stylesheet contents
- $placement : string = 'APPEND'
-
Append, prepend, or set
- $attributes : string|array<string|int, mixed> = []
-
Optional attributes to utilize
Return values
HeadStyle —headTitle()
Retrieve placeholder for title element and optionally set state.
public
headTitle([string $title = null ][, string $setType = null ]) : HeadTitle
Parameters
- $title : string = null
- $setType : string = null
Return values
HeadTitle —inlineScript()
Return InlineScript object.
public
inlineScript([string $mode = InlineScript::FILE ][, string $spec = null ][, string $placement = 'APPEND' ][, array<string|int, mixed> $attrs = [] ][, string $type = 'text/javascript' ]) : InlineScript
Parameters
- $mode : string = InlineScript::FILE
-
Script or file
- $spec : string = null
-
Script/url
- $placement : string = 'APPEND'
-
Append, prepend, or set
- $attrs : array<string|int, mixed> = []
-
Array of script attributes
- $type : string = 'text/javascript'
-
Script type and/or array of script attributes