Property | Type | Description | |
---|---|---|---|
$contentMap | array | Used by output handlers to calculate asset paths in conjunction with the Media class. |
Property | Type | Description | |
---|---|---|---|
$_metaLinks | array | Data used for custom links. | |
$_metaList | array | List of meta tags to cache and to output. | |
$_strings | array | String templates used by this helper. |
Method | Description | |
---|---|---|
charset ( string $encoding = null ) : string | Returns a charset meta-tag for declaring the encoding of the document. | |
head ( string $tag, array $options ) : mixed | Creates a tag for the section of your document. | |
image ( string $path, array $options = [] ) : string | Creates a formatted element. | |
link ( string $title, mixed $url = null, array $options = [] ) : string | Creates an HTML link () or a document meta-link (). | |
script ( mixed $path, array $options = [] ) : string | Returns a JavaScript include tag ( element). If the filename is prefixed with '/', the path will be relative to the base path of your application. Otherwise, the path will be relative to your JavaScript path, usually webroot/js. | |
style ( mixed $path, array $options = [] ) : string | Creates a element for CSS stylesheets or a tag. If the filename is prefixed with '/', the path will be relative to the base path of your application. |
Method | Description | |
---|---|---|
_metaLink ( string $type, mixed $url = null, array $options = [] ) : string | Creates a link to an external resource. |
protected _metaLink ( string $type, mixed $url = null, array $options = [] ) : string | ||
$type | string | The title of the external resource |
$url | mixed | The address of the external resource or string for content attribute |
$options | array | Other attributes for the generated tag. If the type attribute is 'html', 'rss', 'atom', or 'icon', the mime-type is returned. |
return | string |
public charset ( string $encoding = null ) : string | ||
$encoding | string | The character encoding to be used in the meta tag. Defaults to the encoding of the `Response` object attached to the current context. The default encoding of that object is `UTF-8`. The string given here is not manipulated in any way, so that values are rendered literally. Also see above note about casing. |
return | string | A meta tag containing the specified encoding (literally). |
public image ( string $path, array $options = [] ) : string | ||
$path | string | Path to the image file. If the filename is prefixed with `'/'`, the path will be relative to the base path of your application. Otherwise the path will be relative to the images directory, usually `app/webroot/img/`. If the name starts with `'http://'`, this is treated as an external url used as the `src` attribute. |
$options | array | Array of HTML attributes. |
return | string | Returns a formatted `` tag. |
public link ( string $title, mixed $url = null, array $options = [] ) : string | ||
$title | string | The content to be wrapped by an `` tag, or the `title` attribute of a meta-link ``. |
$url | mixed | Can be a string representing a URL relative to the base of your Lithium application, an external URL (starts with `'http://'` or `'https://'`), an anchor name starting with `'#'` (i.e. `'#top'`), or an array defining a set of request parameters that should be matched against a route in `Router`. |
$options | array | The available options are: - `'escape'` _boolean_: Whether or not the title content should be escaped. Defaults to `true`. - `'type'` _string_: The meta-link type, which is looked up in `Html::$_metaLinks`. By default it accepts `atom`, `rss` and `icon`. If a `type` is specified, this method will render a document meta-link (``), instead of an HTML link (``). - any other options specified are rendered as HTML attributes of the element. |
return | string | Returns an `` or `` element. |
public script ( mixed $path, array $options = [] ) : string | ||
$path | mixed | String The name of a JavaScript file, or an array of names. |
$options | array | Available options are: - `'inline'` _boolean_: Whether or not the `` element should be output inline. When set to false, the `scripts()` handler prints out the script, and other specified scripts to be included in the layout. Defaults to `true`. This is useful when page-specific scripts are created inline in the page, and you'd like to place them in the ` | ` along with your other scripts. - any other options specified are rendered as HTML attributes of the element.
return | string |
public style ( mixed $path, array $options = [] ) : string | ||
$path | mixed | The name of a CSS stylesheet in `/app/webroot/css`, or an array containing names of CSS stylesheets in that directory. |
$options | array | Available options are: - `'inline'` _boolean_: Whether or not the `` element should be output inline. When set to `false`, the `styles()` handler prints out the styles, and other specified styles to be included in the layout. Defaults to `true`. This is useful when page-specific styles are created inline in the page, and you'd like to place them in the ` | ` along with your other styles. - `'type'` _string_: By default, accepts `stylesheet` or `import`, which respectively correspond to `style-link` and `style-import` strings templates defined in `Html::$_strings`. - any other options specified are rendered as HTML attributes of the element.
return | string | CSS or tag, depending on the type of link. |
protected array $_metaLinks | ||
return | array |
protected array $_metaList | ||
return | array |
protected array $_strings | ||
return | array |
public array $contentMap | ||
return | array |