Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

compile tpl

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
alal
Smarty n00b


Joined: 16 Dec 2004
Posts: 2

PostPosted: Thu Dec 30, 2004 4:32 pm    Post subject: compile tpl Reply with quote

if you run this on the file full name and add to
SmartyCompileCheck.class.inc
the line
$this->compiler_file = 'Smarty_CompilerCheck.class.php';

and intersept all the error in the Smarty_CompilerCheck.class.php file

you'll get compiler that return the errors to your $err and do with it what u like
Smile


function CHECKTPL($filename)
{
require_once "SmartyCompileCheck.class.inc";
$smarty = new SmartyCompileCheck ;
$output = $smarty->fetch($filename);
$err = count($smarty->getErrors()) ;
if(($err > 0))
{
$result = ($smarty->getErrors()) ;
return $result ;
}
//no errors found
else
return '';
}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP