If $url starts with 'http://' or 'https://', this is treated as an external link.
Otherwise, it is treated as a path to controller/action and parsed using
the Router::match() method (where Router is the routing class dependency specified by
the rendering context, i.e. lithium\template\view\Renderer::$_classes).
If $url is empty, $title is used in its place.
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. |
Результат | string | Returns an `` or `` element. |