Logic-less View/Mustache Module for Kohana v3

Installs: 6 318

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 44


v1.0.0 2013-07-26 16:15 UTC

This package is not auto-updated.

Last update: 2024-02-12 11:56:06 UTC


Kostache is a Kohana 3 module for using Mustache templates in your application.


To use, simply create a POPO (Plain Old PHP Object) like so:


class View_Test
	public $hello = 'world';

	public function testing()
		return 'foobar';

And create a mustache renderer. The parameter to the engine method is the template name to use.


$renderer = Kostache::factory();

And render it:


$this->response->body($renderer->render(new View_Test));


Templates should go in the templates/ directory in your cascading file system. They should have a .mustache extension.


Partials are loaded automatically based on the name used in the template. So if you reference {{>foobar}} in your template, it will look for that partial in templates/partials/foobar.mustache.


KOstache supports layouts. To use, just add a templates/layout.mustache file (a simple one is already provided), and use Kostache_Layout for your renderer instead of Kostache. You'll probably want to put a $title property in your view class. The layout should include a {{>content}} partial to render the body of the page.

Additional Information

For specific usage and documentation, see:

PHP Mustache

Original Mustache