public method

Creates a <link /> element for CSS stylesheets or a <style /> tag. 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 stylesheets path, usually webroot/css.


  • mixed $path

    The name of a CSS stylesheet in webroot/css, or an array containing names of CSS stylesheets in that directory.

  • array $options

    Available options are:

    • 'inline' boolean: Whether or not the <style /> 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 <head /> 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.



CSS or