Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="{{ asset(assetsPath~'/vendor/requirejs/require.js') }}"></script>
- <script>
- // let the baseUrl be dynamic so we can use the compiled assets when needed
- requirejs.config({
- baseUrl: '{{ app.request.basePath }}/{{ assetsPath }}/js',
- paths: {
- routes: '{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}'
- }
- {#,paths: {#}
- {#fos_routing: '{{ asset('bundles/fosjsrouting/js/router.js') }}',#}
- {#fos_routing_data: '{{ path('fos_js_routing_js', {'_format': 'json', 'noext': 1}) }}'#}
- {#},#}
- {#shim: {#}
- {#fos_routing: { exports: 'Routing' }#}
- {#}#}
- });
- /**
- * The heart of our require.js setup!
- *
- * 1) Require the common.js file to get all the paths and shim setup
- * 2) Once that file is downloaded, download and execute app/default.js
- * (a global module, executed on every page) and execute whatever
- * page-specific app we have (e.g. app/homepage). This will do
- * whatever craziness we want.
- */
- require(['common'], function (common) {
- {% if module %}
- require(['app/default', '{{ module }}']);
- {% else %}
- require(['app/default']);
- {% endif %}
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement