Forums / Developer / eZTemplate::fetch($template=false, ...)
Willie Seabrook
Thursday 28 August 2003 5:23:53 pm
How is $template specified correctly? I've tried to specify a template in my code and ez can't find it.
For example, I have a new site called newsite and I need to fetch a template in /design/newsite/override/templates/new.tpl
$tpl->fetch('design:newsite/override/templates/new.tpl');
doesn't work
Jan Borsodi
Thursday 28 August 2003 10:25:31 pm
How was the $tpl object initialized, did you just new the eZTemplate class or did you use the template initialization in kernel/common/template.php?
-- Amos Documentation: http://ez.no/ez_publish/documentation FAQ: http://ez.no/ez_publish/documentation/faq
Thursday 28 August 2003 10:54:40 pm
include_once( "kernel/common/template.php" ); $tpl =& templateInit(); $tpl->setVariable( 'myvar', "Some dumb variable!!!" );$templateResult =& $tpl->fetch( 'design:newsite/override/templates/new.tpl');
I'm sure thats correct.... i copied it out of another bit of ezpublish. This code is being executed inside a event in a workflow and is not for output. The templateResult is to be written to a file (once i get it working that is) :-)