https://github.com/webman-php/blade
A standalone version of Laravel's Blade templating engine for use outside of Laravel.
https://github.com/webman-php/blade
Last synced: about 2 months ago
JSON representation
A standalone version of Laravel's Blade templating engine for use outside of Laravel.
- Host: GitHub
- URL: https://github.com/webman-php/blade
- Owner: webman-php
- Fork: true (jenssegers/blade)
- Created: 2022-11-26T07:15:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-08-05T13:19:05.000Z (7 months ago)
- Last Synced: 2026-01-11T17:56:00.471Z (about 2 months ago)
- Language: PHP
- Homepage: https://jenssegers.com
- Size: 55.7 KB
- Stars: 5
- Watchers: 0
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Blade
[](https://packagist.org/packages/jenssegers/blade) [](https://travis-ci.org/jenssegers/blade) [](https://coveralls.io/r/jenssegers/blade)
The standalone version of [Laravel's Blade templating engine](https://laravel.com/docs/5.8/blade) for use outside of Laravel.
## Installation
Install using composer:
```bash
composer require jenssegers/blade
```
## Usage
Create a Blade instance by passing it the folder(s) where your view files are located, and a cache folder. Render a template by calling the `make` method. More information about the Blade templating engine can be found on http://laravel.com/docs/5.8/blade.
```php
use Jenssegers\Blade\Blade;
$blade = new Blade('views', 'cache');
echo $blade->make('homepage', ['name' => 'John Doe'])->render();
```
Alternatively you can use the shorthand method `render`:
```php
echo $blade->render('homepage', ['name' => 'John Doe']);
```
You can also extend Blade using the `directive()` function:
```php
$blade->directive('datetime', function ($expression) {
return "format('F d, Y g:i a'); ?>";
});
```
Which allows you to use the following in your blade template:
```
Current date: @datetime($date)
```
The Blade instances passes all methods to the internal view factory. So methods such as `exists`, `file`, `share`, `composer` and `creator` are available as well. Check out the [original documentation](https://laravel.com/docs/5.8/views) for more information.
## Integrations
- [Phalcon Slayer Framework](https://github.com/phalconslayer/slayer) comes out of the box with Blade.