database and tpl?

Author Message

Rizwan Ahmad

Friday 11 July 2003 5:23:46 am

How to use database related function in the tpl?

Karsten Jennissen

Friday 11 July 2003 5:34:14 am

Could you please explain a bit more what you are trying to do? This info is too short to give an answer. :-)

Karsten
P.S.: Please don't double or cross-post. Thanks.

Rizwan Ahmad

Sunday 13 July 2003 11:57:07 pm

I want to write a qurey in the tpl to extract the data according to the query. The fetch command extract the specified data only. What if I want to use my own query. Although the answer is available at http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_db/data_retrieval but that does not specify how I can incorporate the php in tpl

Karsten Jennissen

Monday 14 July 2003 12:51:13 am

Hi,

now we have two threads with the same question. :-) Anyhow, PHP is not available in templates (seperation of code and layout). If you want to do something that the current template functions / operators do not support, you will have to write an extension. If it is a quick PHP call you want in your template, you might consider writing a template operater. In the Admin under Set-up there is a point called RAD. You can use this to write the operator.

Check the docs on extensions (link I posted in the other thread), on how to do this.

Karsten

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 22:26:16
Script start
Timing: Jan 18 2025 22:26:16
Module start 'layout'
Timing: Jan 18 2025 22:26:16
Module start 'content'
Timing: Jan 18 2025 22:26:18
Module end 'content'
Timing: Jan 18 2025 22:26:18
Script end

Main resources:

Total runtime1.5230 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 587.7969152.6094
Module start 'layout' 0.00480.0028 740.406339.4141
Module start 'content' 0.00761.5140 779.8203475.3984
Module end 'content' 1.52160.0013 1,255.218812.1875
Script end 1.5230  1,267.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2203160.0002
Check MTime0.00130.0825160.0001
Mysql Total
Database connection0.00070.043910.0007
Mysqli_queries1.477296.9950600.0246
Looping result0.00060.0406580.0000
Template Total1.487597.720.7437
Template load0.00220.146720.0011
Template processing1.485297.517920.7426
Template load and register function0.00020.014510.0002
states
state_id_array0.00120.079810.0012
state_identifier_array0.00150.095620.0007
Override
Cache load0.00170.1097150.0001
Sytem overhead
Fetch class attribute can translate value0.00120.075620.0006
Fetch class attribute name0.00130.084040.0003
XML
Image XML parsing0.00020.014120.0001
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00300.1983100.0003
String conversion0.00000.000540.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs