php - Symfony2 assets:install changes reference

936

I'm trying to use:

{% stylesheets '@Bundle/Resources/public/css/style.css' filter='rename_filter' %}
    <link rel="stylesheet" type="text/css" href="{{ asset_url }}">
{% endstylesheets %}

After running assets:install the reference to the css file has change to /css/40ae858_style_1.css. Is there any way to use the original reference? At least when env=dev.

I'm not using assetic:dump while developing but will be using it on the production server.

732

Answer

Solution:

Your nearly there please use.

   {% stylesheets 'bundles/yourbundlename/css/*' filter='cssrewrite' %}
         <link rel="stylesheet" href="{{ asset_url }}" />
   {% endstylesheets %}

Direct access {{ asset('/bundles/yourbundlename/css/thefilename.css') }}

People are also looking for solutions to the problem: performance - PHP - Using Cron Jobs and GD together

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.