PHP code example of tc / twig-global-bundle

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

    

tc / twig-global-bundle example snippets


$bundles = array(
    // ...
    
    new Tc\Bundle\TwigGlobal\TcTwigGlobalBundle(),
    
    // ...
);

$container->get('tc.twig_global')->set('title', 'something');
$container->get('tc.twig_global')->get('title');
$container->get('tc.twig_global')->merge('colors', 'blue');
// etc