K
K
kovalevich2014-10-23 12:08:08
symfony
kovalevich, 2014-10-23 12:08:08

Symfony 2 - Where to put and how to include css/js?

Welcome all.
Decided to master Symfony2. Help with including resources in twig template engine.
Tried placing css in app/Resorces/public/css

{% stylesheets "/Resources/public/css/*" %}
    <link type="text/css" rel="stylesheet" media="all" href="{{ asset_url }}" />
{% endstylesheets %}

what's wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2014-10-23
Protko @Fesor

BEST PRACTICE
Store your assets in the web/ directory.
symfony.com/doc/download-best-practices-book
And so your paths are not correct, use relative ones (relative to the template file).

A
Alex, 2014-10-23
@shoomyst

You can play around with the asset, but it's better to immediately look towards bower/grunt/gulp

S
SweetLemonade, 2014-10-26
@SweetLemonade

The guy painted and tested more than enough stackoverflow.com/questions/9500573/path-of-assets...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question