web\View registerLinkTag()

registerLinkTag() public method

Registers a link tag.

For example, a link tag for a custom favicon can be added like the following:

$view->registerLinkTag(['rel' => 'icon', 'type' => 'image/png', 'href' => '/myicon.png']);

which will result in the following HTML: <link rel="icon" type="image/png" href="/myicon.png">.

Note: To register link tags for CSS stylesheets, use registerCssFile() instead, which has more options for this kind of link tag.

public void registerLinkTag ( $options, $key = null )
$options array

The HTML attributes for the link tag.

$key string

The key that identifies the link tag. If two link tags are registered with the same key, the latter will overwrite the former. If this is null, the new link tag will be appended to the existing ones.

doc_Yii
2016-10-30 17:17:35
Comments
Leave a Comment

Please login to continue.