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

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

johntaa/blade
=============

The standalone version Blade Template Engine from Laravel in a single php file

v1.0(9y ago)042MITPHPPHP &gt;=5.4

Since Dec 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Johntaa/blade)[ Packagist](https://packagist.org/packages/johntaa/blade)[ Docs](https://github.com/EFTEC/BladeOne)[ RSS](/packages/johntaa-blade/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![Logo](https://github.com/EFTEC/BladeOne/raw/gh-pages/images/bladelogo.png)](https://github.com/EFTEC/BladeOne/blob/gh-pages/images/bladelogo.png)

BladeOne
========

[](#bladeone)

BladeOne is a standalone version of Blade Template Engine that uses a single php file and can be ported and used in different projects.

Introduction (From Laravel webpage)
-----------------------------------

[](#introduction-from-laravel-webpage)

Blade is the simple, yet powerful templating engine provided with Laravel. Unlike other popular PHP templating engines, Blade does not restrict you from using plain PHP code in your views. All Blade views are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade view files use the .blade.php file extension and are typically stored in the resources/views directory.

About this version
------------------

[](#about-this-version)

By standard, Blade is part of Laravel (Illuminate components) and for to use it, you requires to install Laravel and Illuminate-view components. Blade as a template engine is pretty nice and clear. Also it generates a (some that) clean code. And its starting to be considered a de-facto template system for php (Smarty has been riding off the sunset since years ago). So, if we are able to use it without Laravel then its a big plus for many projects. In fact, in theory its is even possible to use with Laravel. Exists different version of Blade Template that runs without Laravel but most requires 50 or more files and those templates add a new level of complexity:

- More files to manages.
- Changes to the current project (if you want to integrate the template into an existent one)
- Incompatibilities amongst other projects.
- Slowness (if your server is not using op-cache)
- Most of the code in the original Blade is used for future use, including the chance to use a different template engine.
- Some Laravel legacy code.

This project uses a single file called BladeOne.php and a single class (called BladeOne). If you want to use it then include it, creates the folders and that's it!. Nothing more (not even namespaces)\*\[\]:

Usage
-----

[](#usage)

example.php:

```
