endel / slim-lightncandy-view
Slim Framework view helper built on top of the Handlebars/Mustache template engines, via lightncandy.
dev-master
2017-05-07 15:49 UTC
Requires
- php: >=5.3.0
- pimple/pimple: ~3.0
- zordius/lightncandy: ^1.0
Requires (Dev)
- phpunit/phpunit: 4.6.0
- slim/slim: ^3.0.0
This package is not auto-updated.
Last update: 2024-12-21 19:21:17 UTC
README
This is a Slim Framework view helper built on top of the Lightncandy templating component, which is an extremely fast PHP implementation of handlebars and mustache.
You can use this component to create and render templates in your Slim Framework application.
Requires Slim 3.x.x
Install
Via Composer
$ composer require endel/slim-lightncandy-view
Usage
// Create Slim app $app = new \Slim\App(); // Register Lightncandy View helper $app->register(new \Slim\Views\Lightncandy('path/to/templates', [ 'helpers' => array(...) 'block_helpers' => array(...) ])); // Define named route $app->get('/hello/{name}', function ($request, $response, $args) { $this['view']->render('profile', [ 'name' => $args['name'] ]); })->setName('profile'); // Run app $app->run();
Examples
Take a look at the example directory for usage examples.
Testing
phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.