2017 © Pedro Peláez
 

library standalone-blade

image

mejta/standalone-blade

  • Wednesday, June 20, 2018
  • by mejta
  • Repository
  • 0 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 67 % Grown

The README.md

Standalone Laravel Blade template engine

This project provide Blade as a standalone library that works with 5.6 Laravel Blade. See blade documentation: https://laravel.com/docs/5.6/blade, (*1)

Compatible with

  • PHP >= 7.1

Instalation

composer require mejta/standalone-blade

Usage

use Mejta\StandaloneBlade;

$viewDirs = [
    __DIR__ . '/views',
];

$cacheDir = __DIR__ . '/cache';

$engine = new StandaloneBlade($viewDirs, $cacheDir);

// Define custom directives
$engine->directive('datetime', function($expression) {
    return "format('m/d/Y H:i'); ?>";
});

// Define custom if statements
$engine->if('env', function($environment) {
    return app()->environment($environment);
});

// Share variables with all templates
$engine->share('key', 'value');

// Render template
echo $engine->render('page-template', [
    'title' => 'Page title',
    'content' => 'Some example page content',
]);

The Versions

20/06 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Mejta

laravel blade

20/06 2018

v5.6.1

5.6.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Mejta

laravel blade

21/02 2018

v5.6

5.6.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Mejta

laravel blade

14/01 2018

v5.5

5.5.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Daniel Mejta

laravel blade