We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Issue Use stylesheetLink

Hallo, before i use stylesheet like :

<link rel="stylesheet" href="/xxx/css/screen.css" type="text/css" media="screen, projection" />

Now i want to use phalcon tag :

    {{ stylesheetLink("/xxx/css/screen.css") }}

but it's doesn't work, how to implement media=> screen ???

edited Jun '15

hi, u can use

{{ stylesheet_link('css/test.css') }}

or maybe your rewrite rule does not work



39.3k
Accepted
answer

You can pass an array to stylesheetLink that will do what you need.

Look at this:

https://github.com/phalcon/cphalcon/blob/master/tests/unit/Phalcon/Tag/TagStylesheetlinkTest.php#L235

In your case the syntax should be:

{{ stylesheet_link(['css/test.css', 'media':'screen,projection']) }}