An open API service indexing awesome lists of open source software.

https://github.com/rakit/blade

PHP Blade template engine outside Laravel
https://github.com/rakit/blade

Last synced: 2 months ago
JSON representation

PHP Blade template engine outside Laravel

Awesome Lists containing this project

README

          

Rakit Blade
--------------

[![Build Status](https://img.shields.io/travis/rakit/blade.svg?style=flat-square)](https://travis-ci.org/rakit/blade)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://doge.mit-license.org)

Blade Template Engine outside Laravel Framework.

## Usage Example

```php
render('myview');

// or render with data
$rendered = $blade->render('myview', [ 'message' => 'foobar' ]);

```

## Extending Compiler

You can extend compiler using `extend` method.

```php

// register @upper() compiler
$blade->extend(function($view, $compiler) {
$pattern = $compiler->createMatcher('upper');
return preg_replace($pattern, '$1', $view);
});

// you can use it in your view file by @upper('my string')

```