Tiny bundle for Laravel which allows you to use the mustache template language for your views. It uses the mustache.php class built by bobthecow and renders files with the extension ".mustache".
Installing the bundle is done in 3 easy steps:
- Download the source
- Register the bundle
- Change the view alias
Download/clone the source into your bundles directory.
Register the bundle in your application/bundles.php file.
'mustacheview' => array(
'autoloads' => array(
'map' => array(
'Mustache\\View' => '(:bundle)/view.php',
'Mustache\\Mustache' => '(:bundle)/mustache.php'
)
)
)
This view extends the Laravel\View class and replaces it to provide mustache functionality, so you'll need to modify your application/config/application.php file, replacing the 'View' alias with one that points to the mustache view.
'aliases' => array(
...
'View' => 'Mustache\\View',
)
The view should work like any other view, other than the fact that you use mustache files (with the file extension '.mustache') to build your templates rather than PHP files. This does mean that none of the helper functions are available, so build your controllers accordingly.
For information about the mustache syntax, see the manual: mustache(5)
Copyright (c) 2012 The Lonely Coder
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source distribution.