nic-d / slim3-mustache
Allows you to use Mustache in Slim 3.
dev-master
2017-05-25 05:05 UTC
Requires
- mustache/mustache: ^2.0
- psr/http-message: ^1.0
Requires (Dev)
- phpunit/phpunit: ^6.0
- slim/slim: ^3.0.0
This package is auto-updated.
Last update: 2025-03-22 11:07:34 UTC
README
Adds support for MustachePHP for rendering views in Slim 3.
Requirements
Install
composer require nic-d/slim3-mustache
How to use
// Instantiate Mustache and add to the container $container['view'] = function ($container) { $view = new \Slim\Views\Mustache([ 'loader' => new Mustache_Loader_StringLoader(), ]); return $view; };
You can also fetch the Mustache instance by using:
$container->get('view')->getMustache();
Testing
PHPUnit 6.0 or greater required.
phpunit