Skip to content

harikt/blade-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Illuminate View

Build Status

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') }}