https://github.com/endel/slim-lightncandy-view
Mustache / Handlebars template engine for Slim Framework 3.x
https://github.com/endel/slim-lightncandy-view
handlebars mustache slim
Last synced: 10 days ago
JSON representation
Mustache / Handlebars template engine for Slim Framework 3.x
- Host: GitHub
- URL: https://github.com/endel/slim-lightncandy-view
- Owner: endel
- License: mit
- Created: 2015-04-02T22:35:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T15:49:32.000Z (almost 8 years ago)
- Last Synced: 2025-04-12T20:08:46.458Z (10 days ago)
- Topics: handlebars, mustache, slim
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 9
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Slim Framework Lightncandy View
[](https://travis-ci.org/endel/slim-lightncandy-view)
This is a Slim Framework view helper built on top of the
[Lightncandy](https://github.com/zordius/lightncandy) templating component,
which is an extremely fast PHP implementation of
[handlebars](http://handlebarsjs.com/) and
[mustache](http://mustache.github.io/).You can use this component to create and render templates in your Slim Framework application.
Requires Slim 3.x.x
## Install
Via [Composer](https://getcomposer.org/)
```bash
$ composer require endel/slim-lightncandy-view
```## Usage
```php
// 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](example) directory for usage examples.
## Testing
```bash
phpunit
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Endel Dreyer](https://github.com/endel)
- [Zordius](https://github.com/zordius)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.