ybiel778x/blade

This component is a standalone version of the Blade Template Engine that can be ported and used in different projects. It allows you to use the blade model outside of Laravel.

Maintainers

Package info

github.com/ybiel778x/blade

pkg:composer/ybiel778x/blade

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2021-11-07 18:51 UTC

This package is auto-updated.

Last update: 2026-04-08 04:25:53 UTC


README

This component is a standalone version of the Blade Template Engine that can be ported and used in different projects. It allows you to use the blade model outside of Laravel.

Instal

How to install execute:

composer require ybiel778x/blade

How to use

use CodeAlpha\Blade\BladeCompiler;

require __DIR__ . '/vendor/autoload.php';

//Template folder
$template = __DIR__ . '/views';

//Compiled template folder
$compiled = __DIR__ . '/compiled';

//start instance of blade

$blade = new BladeCompiler($template, $compiled);
$blade->share([
    'example' => 'example shared vars'
]);

//renders the template located in the defined folder
//the template file must contain the final extension like '.blade.php'
//Ex: welcome.blade.php
echo $blade->run("welcome");