문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top