PHP code example of spiral / twig-bridge
1. Go to this page and download the library: Download spiral/twig-bridge 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/ */
spiral / twig-bridge example snippets
class App extends Kernel
{
/*
* List of components and extensions to be automatically registered
* within system container on application start.
*/
protected const LOAD = [
// ...
Spiral\Twig\Bootloader\TwigBootloader::class,
];
}
class TwigExtensionBootloader extends Bootloader
{
public function boot(TwigEngine $engine)
{
$engine->addExtension(new Extension());
}
}
class TwigExtensionBootloader extends Bootloader
{
public function boot(TwigBootloader $twig)
{
$twig->addExtension('container.binding');
}
}