Property | Type | Description | |
---|---|---|---|
$contentMap | array | Maps helper method names to content types as defined by the Media class, where key are method names, and values are the content type that the method name outputs a link to. |
Property | Type | Description | |
---|---|---|---|
$_autoConfig | array | Auto configuration properties. | |
$_classes | array | This property can be overwritten with any class dependencies a helper subclass has. | |
$_context | lithium\template\view\Renderer | The Renderer object this Helper is bound to. | |
$_minimized | array | List of minimized HTML attributes. | |
$_strings | array | Holds string templates which will be merged into the rendering context. |
Method | Description | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. | |
escape ( string $value, mixed $method = null, array $options = [] ) : mixed | Escapes values according to the output type of the rendering context. Helpers that output to non-HTML/XML contexts should override this method accordingly. |
Method | Description | |
---|---|---|
_attribute ( string $key, mixed $value, array $options = [] ) : string | Convert a key/value pair to a valid HTML attribute. | |
_attributes ( array | string $params, string $method = null, array $options = [] ) : string | Converts a set of parameters to HTML attributes into a string. | |
_init ( ) : void | Imports local string definitions into rendering context. | |
_options ( array $defaults, array $scope ) : array | Takes the defaults and current options, merges them and returns options which have the default keys removed and full set of options as the scope. | |
_render ( string $method, string $string, array $params, array $options = [] ) : string | Render a string template after applying context filters Use examples in the Html::link() method: return $this->_render(__METHOD__, 'link', compact('title', 'url', 'options'), $scope); |
public __construct ( array $config = [] ) : void | ||
$config | array | Configuration options. |
return | void |
protected _attribute ( string $key, mixed $value, array $options = [] ) : string | ||
$key | string | The key name of the HTML attribute. |
$value | mixed | The HTML attribute value. |
$options | array | The options used when converting the key/value pair to attributes: - `'escape'` _boolean_: Indicates whether `$key` and `$value` should be HTML-escaped. Defaults to `true`. - `'format'` _string_: The format string. Defaults to `'%s="%s"'`. |
return | string | Returns an HTML attribute/value pair, in the form of `'$key="$value"'`. |
protected _attributes ( array | string $params, string $method = null, array $options = [] ) : string | ||
$params | array | string | The parameters where key is the attribute name and the value the attribute value. When string will simply prepend with the prepend-string (by default `' '`) unless $params is falsey in which case an empty string is returned. This alternative syntax is used by the method internally. |
$method | string | When used as a context handler, the method the handler was called for I.e. `'wrap'`. Currently not used by the method. |
$options | array | Available options are: - `'escape'` _boolean_: Indicates whether the output should be HTML-escaped. Defaults to `true`. - `'prepend'` _string_: String to prepend to each attribute pair. and the final result. Defaults to `' '`. - `'append'` _string_: String to append to result. Defaults to `''`. |
return | string | Attribute string. |
protected _render ( string $method, string $string, array $params, array $options = [] ) : string | ||
$method | string | name of method that is calling the render (for context filters) |
$string | string | template key (in Helper::_strings) to render |
$params | array | associated array of template inserts {:key} will be replaced by value |
$options | array | Available options: - `'handlers'` _array_: Before inserting `$params` inside the string template, `$this->_context`'s handlers are applied to each value of `$params` according to the key (e.g `$params['url']`, which is processed by the `'url'` handler via `$this->_context->applyHandler()`). The `'handlers'` option allow to set custom mapping beetween `$params`'s key and `$this->_context`'s handlers. e.g. the following handler: `'handlers' => array('url' => 'path')` will make `$params['url']` to be processed by the `'path'` handler instead of the `'url'` one. |
return | string | Rendered HTML |
protected array $_autoConfig | ||
return | array |
protected array $_classes | ||
return | array |
protected lithium\template\view\Renderer $_context | ||
return | lithium\template\view\Renderer |
protected array $_minimized | ||
return | array |
protected array $_strings | ||
return | array |
public array $contentMap | ||
return | array |