martynbiz / slim3-view
A wrapper for Slim3 renderer which uses Windwalker renderer (Blade, Twig, PHP etc)
Installs: 1 052
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.0
- windwalker/renderer: ~2.0
Requires (Dev)
- phpunit/phpunit: 4.8.*
- slim/slim: ~3.0
This package is not auto-updated.
Last update: 2024-12-13 18:52:55 UTC
README
Introduction
A simple wrapper for Slim3 renderer which uses Windwalker renderer (Blade, Twig, PHP etc)
See the Windwalker renderer here - https://github.com/ventoviro/windwalker
Installation
Composer
"require-dev": { "martynbiz/slim3-view": "dev-master" }
Usage
Below is an example usage within the slim3 skeleton app:
settings.php
$settings = [
'settings' => [
'renderer' => [
'template_path' => '/path/to/views/',
'cache_path' => '/path/to/cache/views',
],
.
.
.
dependencies.php
// view renderer $container['renderer'] = function ($c) { $settings = $c->get('settings')['renderer']; // choose your weapon.. :) e.g. Blade, Twig, etc $renderer = new \Windwalker\Renderer\BladeRenderer(array( $settings['template_path'], ), array( 'cache_path' => $settings['cache_path'], )); return new \MartynBiz\Slim3View\Renderer($renderer); };