PHPackages                             coolpraz/php-blade - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. coolpraz/php-blade

ActiveLibrary[Templating &amp; Views](/categories/templating)

coolpraz/php-blade
==================

The standalone version of Laravel's Blade templating engine for use outside of Laravel.

v0.1.0(8y ago)98.7k1[2 issues](https://github.com/coolpraz/php-blade/issues)MITPHP

Since May 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/coolpraz/php-blade)[ Packagist](https://packagist.org/packages/coolpraz/php-blade)[ RSS](/packages/coolpraz-php-blade/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

PHP Blade Template Engine
=========================

[](#php-blade-template-engine)

The standalone version of latest [Laravel's Blade templating engine](http://laravel.com/docs/5.4/blade) for use outside of Laravel.

Installation
------------

[](#installation)

Install using composer:

```
composer require coolpraz/php-blade
```

Usage
-----

[](#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 .

```
require __DIR__ . '/vendor/autoload.php';

use Coolpraz\PhpBlade\PhpBlade;

$views = __DIR__ . '/views';
$cache = __DIR__ . '/cache';

$blade = new PhpBlade($views, $cache);

echo $blade->view()->make('meta', ['name' => 'John Doe']);
```

Now you can easily create a directive by calling the `compiler()` function

```
$blade->compiler()->directive('datetime', function ($expression) {
    return "";
});

{{-- In your Blade Template --}}
