Re: [SMARTY] default_template_handler_func

From: Date: Wed, 09 Apr 2003 19:19:02 +0000
Subject: Re: [SMARTY] default_template_handler_func
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9197@lists.php.net to get a copy of this message
Messju, Sorry for the slow reply.. was having a fight with my newsreader... Anyhow.. great work! I made one modification for your tpl_handler to work for my enviroment, I changed the line : $tpl = $smarty->default_template_dir . $resource_name; to $tpl = default_template_dir . $resource_name; because the default_template_dir is a constant I define elsewhere, vs the $smarty->template_dir... Works for me: function tpl_handler($resource_type, $resource_name, &$template_source, &$template_timestamp, &$smarty) { $tpl = default_template_dir . $resource_name; if ($fp=fopen($tpl, 'r')) { $template_source = fread($fp, filesize($tpl)); $template_timestamp = filemtime($tpl); fclose($fp); return true; } // no return means null, means false, means error }

« previous php.smarty.general (#9197) next »