PHP code example of mejta / standalone-blade

1. Go to this page and download the library: Download mejta/standalone-blade library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mejta / standalone-blade example snippets


use Mejta\StandaloneBlade;

$viewDirs = [
    __DIR__ . '/views',
];

$cacheDir = __DIR__ . '/cache';

$engine = new StandaloneBlade($viewDirs, $cacheDir);

// Define custom directives
$engine->directive('datetime', function($expression) {
    return " echo ($expression)->format('m/d/Y H:i');