PHP code example of ride / lib-template-smarty

1. Go to this page and download the library: Download ride/lib-template-smarty 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/ */

    

ride / lib-template-smarty example snippets


use ride\library\template\engine\SmartyEngine;
use ride\library\template\engine\SmartyResourceHandler;

function createSmartyTemplateEngine(System $system) {
    $resourceHandler = new SmartyResourceHandler($system->getFileBrowser(), 'view/smarty');
    $compileDirectory = $system->getFileSystem()->getFile('/path/to/compile/cache');
    $escapeHtml = true;
    
    $engine = new SmartyEngine($resourceHandler, $compileDirectory, $escape);
    $engine->addPublicDirectory('/path/to/plugins');
    
    return $engine;
}