Question

I'm having problems with my child twig templates properly resolving their assets.

My assets lie in web/bundles/mlbp/images|js|css

In my parent twig template that all my other templates inherit from I have something like:

{% block javascripts %}
    <script src="{{ asset('bundles/mlbp/js/jQuery.js') }}" type="text/javascript"></script>
{% endblock %}

When looking at source this resolves properly to /bundles/mlbp/js/jQuery.js

But in one of my child templates I'm doing something like this:

{% block javascripts %}
    {{parent()}}
    <script src="{{ asset('bundles/mlbp/js/tableSortInit.js') }}" type="text/javascript"></script>
{% endblock %}

This for some reason resolves to /js/tableSortInit.js which does not exist. I don't see why it would work in one but not the other so any help will be very appreciated

Was it helpful?

Solution

You should try checking any other templates that relate to that one, it may be coming from those especially if you do a lot of in template rendering etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top