ryangjchandler/standalone-blade

This package is abandoned and no longer maintained. No replacement package was suggested.

Use Laravel's Blade templating engine outside of Laravel.

Fund package maintenance!
ryangjchandler

Installs: 2 657

Dependents: 1

Suggesters: 0

Security: 0

Stars: 36

Watchers: 5

Forks: 3

v0.2.0 2023-02-24 15:16 UTC

README

Latest Version on Packagist Tests Total Downloads

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.