widmogrod / zf2-mustache-module
Zend Framework 2 module providing integration with the Mustache rendering engine.
Installs: 19 259
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 3
Forks: 6
Open Issues: 1
Requires
- php: >=5.3.3
- mustache/mustache: 2.*
- zendframework/zend-eventmanager: 2.*
- zendframework/zend-modulemanager: 2.*
- zendframework/zend-servicemanager: 2.*
- zendframework/zend-view: 2.*
This package is auto-updated.
Last update: 2024-12-07 19:31:54 UTC
README
Summery
Zend Framework 2 module providing integration with mustache.php rendering engine
Requirements
- Zend Framework 2 (https://github.com/zendframework/zf2). Tested on Zend Framework 2.0.0rc6.
Installation
Composer installation
-
cd my/project/directory
-
create a
composer.json
file with following content:{ "require": { "widmogrod/zf2-mustache-module": "dev-master" } }
-
run
php composer.phar install
-
open my/project/folder/configs/application.config.php and add 'Mustache' to your 'modules' parameter.
How to add Mustache rendering to ZF2
Add to your Application module config file (module.config.php) new rendering strategy as following:
<?php return array( 'view_manager' => array( // add this 'strategies' => array( 'Mustache\View\Strategy' ), ), );
How to configure partials
Add to your Application module config file (module.config.php)
<?php return array( 'mustache' => array( 'partials_loader' => array( __DIR__ . '/../view/partials') ), );