\SingletonViewBlockHtmlHelper

SingletonViewBlockHtmlHelper

Summary

Methods
Properties
Constants
__construct()
meta()
css()
script()
scriptBlock()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__copyBlockValue()
$__staticViewBlock
$__staticIncludedAssets
N/A

Properties

$__staticViewBlock

$__staticViewBlock : \View

The same ViewBlock instance this helper is attached to

Type

\View

$__staticIncludedAssets

$__staticIncludedAssets : array

Names of script & css files that have been included once If CakePHP less than 2.6.0, css is not implemented

Type

array

Methods

__construct()

__construct(\View  $View, array  $settings = array()) 

Constructor

Set static View instance and _includedAssets property after parent::__construct

Parameters

\View $View

The View this helper is being attached to.

array $settings

Configuration settings for the helper.

meta()

meta(string  $type, string|array  $url = null, array  $options = array()) : string

View object changed to static View instance for used same BlockView instance

Parameters

string $type

The title of the external resource

string|array $url

The address of the external resource or string for content attribute

array $options

Other attributes for the generated tag. If the type attribute is html, rss, atom, or icon, the mime-type is returned.

Returns

string —

A completed <link /> element.

css()

css(string|array  $path, array  $options = array()) : string

View object changed to static View instance for used same BlockView instance

Parameters

string|array $path

The name of a CSS style sheet or an array containing names of CSS stylesheets. If $path is prefixed with '/', the path will be relative to the webroot of your application. Otherwise, the path will be relative to your CSS path, usually webroot/css.

array $options

Array of options and HTML arguments.

Returns

string —

CSS or tag, depending on the type of link.

script()

script(string|array  $url, array|boolean  $options = array()) : mixed

View object changed to static View instance for used same BlockView instance

Parameters

string|array $url

String or array of javascript files to include

array|boolean $options

Array of options, and html attributes see above. If boolean sets $options['inline'] = value

Returns

mixed —

String of <script /> tags or null if $inline is false or if $once is true and the file has been included before.

scriptBlock()

scriptBlock(string  $script, array  $options = array()) : mixed

View object changed to static View instance for used same BlockView instance

Parameters

string $script

The script to wrap

array $options

The options to use. Options not listed above will be treated as HTML attributes.

Returns

mixed —

string or null depending on the value of $options['block']

__copyBlockValue()

__copyBlockValue(\ViewBlock  $sourceBlock, \ViewBlock  $destinationBlock, array|string  $blockKeys = array()) : void

Copy block value

Parameters

\ViewBlock $sourceBlock

Source of copy block

\ViewBlock $destinationBlock

Destination of copy block

array|string $blockKeys

Copy key