1. Basic grammar
Says something:{{}}
Does something:{%%}
Comment something:{# #}
{% extends "Appwebbundle::layout.html.twig"%} inherit template
2. Core concept:
Managing relationships between pages using the inheritance relationships of classes
If you want to access a resource file in a bundle, you need to copy the file to the/web directory, or the Linux/mac soft connection is mapped to the/web directory
Windows: >php app/console assets:install Web
Linux: >php app/console assets:install Web--symlink--relative
3. js CSS File Management
(1) Use a Css/js file directly: {{asset (' Xxx.js ')}}
(2) Register/define resource: {% javascripts%} {% stylesheets%}
# All JS files in the ' appwebbundle/resources/public/js/' directory will be output sequentially
{% block my_js%} {% javascripts ' @AppWebBundle/resources/public/js/* '%} {% endjavascripts%} { % endblock%}
And in the APP/CONFIG/CONFIG.YML configuration:
Assetic: bundles: [Appwebbundle]
(3) Common policies for sharing css/js files between pages