xaamin/blade

Laravel blade templating out of the box
1,485
Install
composer require xaamin/blade
Latest Version:v1.1.3
Last Updated:Mar 10, 2021
Links: GitHub  ·  Packagist
Maintainer: xaamin

Blade

Standalone version of Blade templating engine for use outside of Laravel.

Installation

composer require xaamin/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.

    use Xaamin\Blade\View;

    $view = new View('views', 'cache');

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

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

    $view->compiler()->directive('money', function ($expression) {
        return "<?= '$ ' . number_format($expression, 2, '.', ','); ?>";
    });

In your Blade Template

    <?php $decimal = '520.50' ?>
    @datetime($decimal)

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.

More information about the Blade templating engine can be found on http://laravel.com/docs/5.3/blade.

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

617,346,630 9,703
laravel/framework

The Laravel Framework.

558,184,770 34,846
laravel/tinker

Powerful REPL for the Laravel framework.

468,807,761 7,441