This package provides a standalone version of Laravel's Blade templating engine for use outside of Laravel.
You can install the package via Composer:
composer require ryangjchandler/standalone-blade
Begin by creating a new instance of the RyanChandler\Blade\Blade
class.
use RyanChandler\Blade\Blade;
$blade = new Blade('/path/to/views', '/path/to/cache');
You can now use the Blade
object to interact with both the Illuminate\View\Factory
instance and the Illuminate\View\Compilers\BladeCompiler
instance.
$html = $blade->make('my-view', ['name' => 'Ryan'])->render();
$blade->directive('echo', fn ($expression) => "<?php echo {$expression}; ?>");
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.