PHP code example of opm87 / twigbridge

1. Go to this page and download the library: Download opm87/twigbridge 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/ */

    

opm87 / twigbridge example snippets


'providers' => [
     // ...

     TwigBridge\ServiceProvider::class,
],

'aliases' => [
    // ...

    'Twig' => TwigBridge\Facade\Twig::class,
],

// app/Http/routes.php
Route::get('/', function () {
    return view('hello');
});

$app->configure('twigbridge');
$app->register('TwigBridge\ServiceProvider');

view('i_am_twig', [...]);

view('pagination::simple');

'enabled' => [
    'TwigBridge\Extensions\Example',
]

'enabled' => [
    function ($app) {
        $factory = new Assetic\Factory\AssetFactory($app['path'].'/../some/path/');
        $factory->setDebug(false);

        // etc...

        return new Assetic\Extension\Twig\AsseticExtension($factory);
    }
]
bash
$ php artisan vendor:publish --provider="TwigBridge\ServiceProvider"