fignon/fignon-blade-engine

The Fignon blade Engine is a simple class which serve as bridge between the Laravel blade template engine and Fignon Framework

0.0.1 2024-02-16 11:26 UTC

This package is auto-updated.

Last update: 2024-04-16 13:18:48 UTC


README

This is a simple class to encapsulate the Laravel Blade template engine and use it easily in the Fignon Framework.

In your Fignon project, run:

composer require fignon/fignon-blade-engine

Then, use it like this:

//app.php (or index.php) depending of how you call you entry point
declare(strict_types=1);

include_once __DIR__ . "/../vendor/autoload.php";

use Fignon\Tunnel;
use App\Features\Features;
use Fignon\Extra\BladeEngine;

$app = new Tunnel();
$app->set('env', 'development');
// ... other middlewares

// View engine initialization
$app->set('views', dirname(__DIR__) . '/templates');
$app->set('views cache', dirname(__DIR__) . '/var/cache');
$app->set('view engine options', []); // Add options to the view engine
$app->engine('blade', new BladeEngine()); 

$app->set('case sensitive routing', true);
//  ... other middlewares


// You can then use it to render
(new Features($app))->bootstrap();

$app->listen();

Other view engine integration to Fignon are: