@@ -30,22 +30,20 @@ Template Locations
30
30
Store all your application's templates in ``app/Resources/views/ `` directory.
31
31
32
32
Traditionally, Symfony developers stored the application templates in the
33
- ``Resources/views/ `` directory of each bundle. Then they used the logical name
34
- to refer to them (e.g. ``AcmeDemoBundle: Default: index.html.twig ``).
33
+ ``Resources/views/ `` directory of each bundle. Then they used the Twig namespaced
34
+ path to refer to them (e.g. ``@AcmeDemo/ Default/ index.html.twig ``).
35
35
36
36
But for the templates used in your application, it's much more convenient
37
37
to store them in the ``app/Resources/views/ `` directory. For starters, this
38
38
drastically simplifies their logical names:
39
39
40
- ================================================= ==================================
41
- Templates Stored inside Bundles Templates Stored in ``app/ ``
42
- ================================================= ==================================
43
- ``AcmeDemoBundle:Default:index.html.twig `` ``default/index.html.twig ``
44
- ``::layout.html.twig `` ``layout.html.twig ``
45
- ``AcmeDemoBundle::index.html.twig `` ``index.html.twig ``
46
- ``AcmeDemoBundle:Default:subdir/index.html.twig `` ``default/subdir/index.html.twig ``
47
- ``AcmeDemoBundle:Default/subdir:index.html.twig `` ``default/subdir/index.html.twig ``
48
- ================================================= ==================================
40
+ ============================================ ==================================
41
+ Templates Stored inside Bundles Templates Stored in ``app/ ``
42
+ ============================================ ==================================
43
+ ``@AcmeDemo/index.html.twig `` ``index.html.twig ``
44
+ ``@AcmeDemo/Default/index.html.twig `` ``default/index.html.twig ``
45
+ ``@AcmeDemo/Default/subdir/index.html.twig `` ``default/subdir/index.html.twig ``
46
+ ============================================ ==================================
49
47
50
48
Another advantage is that centralizing your templates simplifies the work
51
49
of your designers. They don't need to look for templates in lots of directories
@@ -131,7 +129,7 @@ service in the constructor of the Twig extension:
131
129
new \Twig_SimpleFilter(
132
130
'md2html',
133
131
array($this, 'markdownToHtml'),
134
- array('is_safe' => array('html'))
132
+ array('is_safe' => array('html'), 'pre_escape' => 'html' )
135
133
),
136
134
);
137
135
}
0 commit comments