ryangjchandler / standalone-blade
Use Laravel's Blade templating engine outside of Laravel.
Fund package maintenance!
ryangjchandler
Requires
- php: ^8.1
- illuminate/config: ^10.0
- illuminate/support: ^10.0
- illuminate/view: ^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^1.20
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-01-07 23:27:05 UTC
README
This package provides a standalone version of Laravel's Blade templating engine for use outside of Laravel.
Installation
You can install the package via Composer:
composer require ryangjchandler/standalone-blade
Usage
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}; ?>");
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.