PHP code example of kktsvetkov / smarty2

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

    

kktsvetkov / smarty2 example snippets


$smarty->getResourceAggregate()->register('admin',
	new Smarty2\Resource\FolderResource('admin/templates')
	);

$smarty = new Smarty2\Engine;
$smarty->setSecurityPolicy(
	new Smarty2\Security\Policy(
		Smarty2\Security\Policy::DEFAULT_IF_FUNCS,
		Smarty2\Security\Policy::DEFAULT_MODIFIER_FUNCS,
		$allowConstants = false,
		$allowSuperGlobals = true		
	)
);

...
$smarty->display('index.tpl');
print_r($smarty->_smarty_debug_info);

php composer.phar 
 do_something();