There is a config.php code:
<? require_once($config['basedir'].'/smarty/libs/Smarty.class.php'); require_once($config['basedir'].'/libraries/adodb/adodb.inc.php'); $smarty = new Smarty(); $smarty->compile_dir = $config['basedir']."/temporary"; $smarty->template_dir = $config['basedir']."/themes"; $smarty->assign('baseurl', $config['baseurl']); for ($i=0; $i<count($lang); $i++) { $smarty->assign('lang'.$i, $lang[$i]); } ?> This code is included in the root index.php (and everywhere where templates are needed)
<?php include("include/config.php"); $smarty->assign('news',$news); //TEMPLATES BEGIN $smarty->display('header.tpl'); $smarty->display('index.tpl'); $smarty->display('footer.tpl'); ?> Is it possible to create an instance of the Smarty class everywhere? (i.e. include everywhere config.php with $ smarty = new Smarty (); ) Ie always use memory per class.