css - href assetic doesn't work -
i'm trying link stylesheet html template, doesn't seem work.
i use symfony2 , assetic. in demo bundle, css linked line:
<link rel="stylesheet" href="{{ asset('bundles/acmedemo/css/demo.css') }}" />
so, in mainbundle, wrote lines
<head> <style> {% block stylesheets %} <link href="{{ asset('bundles/acmemain/css/demo.css') }}" rel="stylesheet" /> {% endblock %} </style> </head>
and put demo.css file in folder
acme\mainbundle\resources\public\css,
then executed
php app/console assets:install
in situation, web page doesn't have css style, without formattation. if write css directly in template, works. if link it, doesn't work.
how can solve this?
my css file line:
h1{color:blue;text-align:center;}
thank you.
you have execute command copy stylesheets (found in public folder) in web folder because asset()
function looking sheets in folder
php app/console asset:install
look @ doc more explanations
Comments
Post a Comment