Hi
I'm trying to learn Silex/Twig, but I've come across a small issue... In every "tutorial" I've seen, the speaker uses the "asset"-function to include JS and CSS. Unfortunately, this doesn't seem to work for me...
I get the following error: "Twig_Error_Syntax: The function "asset" does not exist in "base.html" at line 8"Code PHP:<link href="{{ asset('/css/index.css') }}" rel="stylesheet" media="all" />
I can replace the css-include to the following and it works:
Code PHP:<link href="{{ app.request.basepath }}/css/mails.css" rel="stylesheet" media="all" />
I'm just wondering why the first piece of code isn't working...
Thx!
Edit: I downloaded Silex fully on their site (.zip)



Reply With Quote
Bookmarks