nic-d / slim3-mustache
Allows you to use Mustache in Slim 3.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/nic-d/slim3-mustache
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-10-22 12:28:24 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