0

Suppose i have following code in my view:

{% set foo = '@CmsFooBundle/Resources/public/js/scripts.js' %}

{% javascripts filter="yui_js"
    '@CmsBarBundle/Resources/public/js/other_scripts.js'
     %}
     <script src="{{ asset_url }}"></script>
{% endjavascripts %}

Question: how to pass "foo" variable as an argument into "javascripts" block?

1

1 Answer 1

1

From Pass a variable to an Assetic asset URL in Symfony2 is a link to this blog article http://jmsyst.com/blog/asset-variables-in-assetic

it shows you how to do it, although you need to have a finite number of variables and Assetic 1.1+

Sign up to request clarification or add additional context in comments.

1 Comment

The URL you included doesn't work anymore. Could you please provide another one @stefancarlton ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.