-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from markri/master
README, bugfix, namespace issue
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
MustacheBundle | ||
============== | ||
|
||
A Symfony implementation of the Mustache template rendering. This will add Mustache as a renderer in Symfony | ||
|
||
1) Installing | ||
------------- | ||
|
||
### Composer | ||
|
||
Just run following command with composer: | ||
|
||
composer.phar require bobthecow/mustache-bundle | ||
|
||
Lookup desired version constraint from packagist. After adding this run | ||
|
||
composer.phar update | ||
|
||
|
||
### AppKernel | ||
|
||
To actually download and use this bundle. Also add following line to your `AppKernel.php` | ||
|
||
new Bobthecow\Bundle\MustacheBundle\BobthecowMustacheBundle() | ||
|
||
|
||
### config.yml | ||
|
||
Add rendererer to your config.yml | ||
|
||
framework: | ||
templating: | ||
engines: ['twig', 'mustache'] | ||
|
||
|
||
2) Using it | ||
----------- | ||
|
||
Like you would use twig. Just put your mustache file in your Resources\views folder using `.mustache` as extension. | ||
E.g. | ||
|
||
// Render Mustache template and return response | ||
return $this->render('AcmeDemoBundle:Hello:index.html.mustache'); | ||
|
||
Or pass along the template in the Template() annotation | ||
|
||
/** | ||
* @Template("AcmeDemoBundle:Hello:index.html.mustache") | ||
*/ | ||
public function indexAction() | ||
{ | ||
return array(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters