File tree 3 files changed +58
-3
lines changed
3 files changed +58
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function warmUp($cacheDir)
57
57
}
58
58
59
59
try {
60
- $ mustache ->loadTemplate ($ mustache );
60
+ $ mustache ->loadTemplate (( string ) $ template );
61
61
} catch (\Exception $ e ) {
62
62
// problem during compilation, give up
63
63
}
Original file line number Diff line number Diff line change
1
+ MustacheBundle
2
+ ==============
3
+
4
+ A Symfony implementation of the Mustache template rendering. This will add Mustache as a renderer in Symfony
5
+
6
+ 1 ) Installing
7
+ -------------
8
+
9
+ ### Composer
10
+
11
+ Just run following command with composer:
12
+
13
+ composer.phar require bobthecow/mustache-bundle
14
+
15
+ Lookup desired version constraint from packagist. After adding this run
16
+
17
+ composer.phar update
18
+
19
+
20
+ ### AppKernel
21
+
22
+ To actually download and use this bundle. Also add following line to your ` AppKernel.php `
23
+
24
+ new Bobthecow\Bundle\MustacheBundle\BobthecowMustacheBundle()
25
+
26
+
27
+ ### config.yml
28
+
29
+ Add rendererer to your config.yml
30
+
31
+ framework:
32
+ templating:
33
+ engines: ['twig', 'mustache']
34
+
35
+
36
+ 2 ) Using it
37
+ -----------
38
+
39
+ Like you would use twig. Just put your mustache file in your Resources\views folder using ` .mustache ` as extension.
40
+ E.g.
41
+
42
+ // Render Mustache template and return response
43
+ return $this->render('AcmeDemoBundle:Hello:index.html.mustache');
44
+
45
+ Or pass along the template in the Template() annotation
46
+
47
+ /**
48
+ * @Template("AcmeDemoBundle:Hello:index.html.mustache")
49
+ */
50
+ public function indexAction()
51
+ {
52
+ return array();
53
+ }
54
+
55
+
Original file line number Diff line number Diff line change 17
17
"mustache/mustache" : " ~2.5"
18
18
},
19
19
"autoload" : {
20
- "psr-0" : { "Bobthecow\\ Bundle\\ BobthecowMustacheBundle " : " " }
20
+ "psr-0" : { "Bobthecow\\ Bundle\\ MustacheBundle " : " " }
21
21
},
22
- "target-dir" : " Bobthecow/Bundle/BobthecowMustacheBundle "
22
+ "target-dir" : " Bobthecow/Bundle/MustacheBundle "
23
23
}
You can’t perform that action at this time.
0 commit comments