Skip to content

Use Laravel's Blade templating engine outside of Laravel.

License

Notifications You must be signed in to change notification settings

Interfacelab/standalone-blade

Repository files navigation

Use Laravel's Blade templating engine outside of Laravel.

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.

About

Use Laravel's Blade templating engine outside of Laravel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •