nsrosenqvist/blade-compiler

Simple class that compiles Laravel Blade files
371 2
Install
composer require nsrosenqvist/blade-compiler
Latest Version:7.0.0
PHP:^7.0
License:MIT
Last Updated:Mar 5, 2020
Links: GitHub  ·  Packagist
Maintainer: nsrosenqvist

Blade Compiler

This is a simple PHP class that wraps Laravel's Blade compiler into a reusable component. This abstraction makes it very convenient to use the Blade templating engine in other projects that aren't built with Laravel.

Sample code

use NSRosenqvist\Blade\Compiler;

$cacheDir = "storage/cache/views";
$baseDirs = [
    'app/views',
    'module/views',
];

$blade = new Compiler($cacheDir, $baseDirs);

$index = $blade->render('index')
// Only works when baseDirs are set (note that just
// 'index.blade.php' wouldn't work since Blade would
// interpret that as 'index/blade/php')

$index = $blade->render('/path/to/index.blade.php')
// Absolute paths always works

Related Packages

nsrosenqvist/blade-cli

Command line version of Laravel's Blade templating engine

13 1
ngangchill/blade

This is a standalone package for laravel blade with some extra function such as...

33 0
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

614,907,009 9,702