M
M
magary42016-04-15 11:01:09
symfony
magary4, 2016-04-15 11:01:09

How to add a list of js files to assets and load it completely into the layout?

Like add this config
assets:
packages:
libs:
- bundles/bower_components/jquery/jquery18.js
- bundles/bower_components/bootstrap/bootstrap.min.js
. . .
and then load everything in the list into the layout?
And the 2nd question
is how, when you turn on the bundle, immediately turn on its routing without editing the app/routing.yml file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elnur Urazymbetov, 2016-04-21
@u_elnur

1) At the expense of assets. Take a look at gulp.js or grunt.js
They are project builders. You can collect css or js files into one file, minify them, work with sass or less, optimize images and much, much more.
2) You can write your own "RouteLoader" service that adds new routes to the application. And the service itself is connected automatically along with the bundle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question