Skip to content

Commit 08f73c7

Browse files
author
M. de Krijger
committed
Added README.md
1 parent 6d3ef07 commit 08f73c7

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+

0 commit comments

Comments
 (0)