PHP code example of snicco / blade-bundle

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

    

snicco / blade-bundle example snippets



// /path/to/configuration/bundles.php

use Snicco\Bundle\Blade\BladeBundle;
use Snicco\Bundle\Templating\TemplatingBundle;

return [
    
    'bundles' => [
        Snicco\Component\Kernel\ValueObject\Environment::ALL => [
            TemplatingBundle::class,
            BladeBundle::class
        ]   
    ]   
];


use Snicco\Component\BetterWPDB\BetterWPDB;
use Snicco\Component\Kernel\Kernel;
use Snicco\Component\Templating\TemplateEngine;

/**
* @var Kernel $kernel
*/
$kernel->boot();

$template_engine = $kernel->container()->make(TemplateEngine::class);

// Assuming you have a welcome.blade.php view

$template_engine->renderView('welcome', ['greet' => 'Calvin']);