PHPackages                             moazamin6/creative-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. moazamin6/creative-blade

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

moazamin6/creative-blade
========================

Standalone laravel blade for all existing and new php projects

3.0(4y ago)256MITPHPPHP ^7.3|^8.0

Since Mar 1Pushed 4y agoCompare

[ Source](https://github.com/moazamin6/creative-blade)[ Packagist](https://packagist.org/packages/moazamin6/creative-blade)[ Docs](https://github.com/moazamin6)[ RSS](/packages/moazamin6-creative-blade/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

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

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

Full compatible to every php application standalone laravel's blade modify on illuminate/view v6.10.0

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

[](#installation)

Install using composer:

```
composer require moazamin6/creative-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 'vendor/autoload.php';

use CreativeBlade\CreativeBlade;

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

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

echo $blade->view()->make('demo', ['message' => 'This is Creative Blade']);
```

In every other standalone blade template package there is a problem that you can not use $this keyword to access your native application features for example if you want to implement blade template in your existing codeigniter application in views files you access your sessions like `$this->session` if you convert your views to blade then your application will crash in this scenario so I modify actual `illuminate/view` package of laravel to solve this problem and I also use existing standalone package `coolpraz/php-blade` so here you can send you data object that you want to access in view like this I will use codeigniter default instance

```
$ci = &get_instance();
$blade = new CreativeBlade($views, $cache,$ci);
```

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

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

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