eZTemplate::fetch($template=false, ...)

Author Message

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

Willie Seabrook

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) :-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 21:10:25
Script start
Timing: Jan 18 2025 21:10:25
Module start 'layout'
Timing: Jan 18 2025 21:10:25
Module start 'content'
Timing: Jan 18 2025 21:10:26
Module end 'content'
Timing: Jan 18 2025 21:10:26
Script end

Main resources:

Total runtime1.0007 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9141152.6250
Module start 'layout' 0.00600.0035 740.539139.4453
Module start 'content' 0.00950.9897 779.9844528.7813
Module end 'content' 0.99920.0015 1,308.76568.1563
Script end 1.0006  1,316.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3367160.0002
Check MTime0.00140.1409160.0001
Mysql Total
Database connection0.00080.077210.0008
Mysqli_queries0.956395.5647570.0168
Looping result0.00050.0481550.0000
Template Total0.966896.620.4834
Template load0.00220.218120.0011
Template processing0.964696.390920.4823
Template load and register function0.00030.027910.0003
states
state_id_array0.00120.124610.0012
state_identifier_array0.00120.123820.0006
Override
Cache load0.00170.1746170.0001
Sytem overhead
Fetch class attribute can translate value0.00070.070520.0004
Fetch class attribute name0.00100.104440.0003
XML
Image XML parsing0.00060.060420.0003
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00090.0925170.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs