harikt / blade-renderer
Laravel blade renderer for Zend expressive
0.4.1
2018-03-15 17:33 UTC
Requires
- illuminate/cache: ^5.5
- illuminate/container: ^5.5
- illuminate/events: ^5.5
- illuminate/filesystem: ^5.5
- illuminate/view: ^5.5
- psr/container: ~1.0
- zendframework/zend-expressive-helpers: ^5.0.0
- zendframework/zend-expressive-router: ^3.0.0
- zendframework/zend-expressive-template: ^2.0.0
Requires (Dev)
- phpunit/phpunit: ^7.0.0
- zendframework/zend-expressive-fastroute: ^3.0.0
README
composer require harikt/blade-renderer
In your config/autoload/templates.global.php
use something as below.
<?php
use Zend\Expressive\Template\TemplateRendererInterface;
use Harikt\Blade\BladeRendererFactory;
return [
'dependencies' => [
'factories' => [
TemplateRendererInterface::class => BladeRendererFactory::class,
],
],
'templates' => [
'paths' => [
'app' => __DIR__ . '/views/app',
]
]
'blade' => [
'cache_dir' => '/cache/path',
],
];
Helper functions
You can make use of zend expressive provided url helper functions with the shared variable $urlHelper
and $serverUrlHelper
.
Example usage.
Hello {{ $name }}
{{ $urlHelper('article_show', ['id' => '3'], ['foo' => 'bar'], 'fragment') }}
{{ $serverUrlHelper('/hello/world') }}