PHP code example of daun / template-engine-latte

1. Go to this page and download the library: Download daun/template-engine-latte 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/ */

    

daun / template-engine-latte example snippets


wire()->addHookAfter('TemplateEngineLatte::initLatte', function (HookEvent $event) {
    /** @var Latte\Engine */
    $latte = $event->arguments('latte');
    $compiler = $latte->getCompiler();

    // Add filter
    $latte->addFilter('lower', function ($str) { return strtolower($str); });

    // Add custom tags via extensions
    $latte->addExtension(new FooExtension);
});