Own php script!

Author Message

Kaiko Kaur

Monday 12 May 2003 9:59:28 pm

I tried to include my own php file to eZ publish. I used followed howto:
http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/howtos/how_can_i_use_my_own_php_script_inside_ezp

But I can not use this variable inside template. As I can understand I should be able to use all php variables inside my template?! But I can't. After reading this I tried {$GLOBALS|attribute(show,1)}, but guess... nothing.
Can somebody help me? Best help is explaining why eZ publish i acting like this!?

Bård Farstad

Wednesday 28 May 2003 2:20:04 am

To get access to a variable inside the template you need to set it first.

You can set template variables with the function setVariable(). A dirty example:

$tpl->setVariable( 'globals', $GLOBALS );

This will set the template variable globals, {$globals}, to the value of all global PHP variables.

However I would not recommend using the GLOBALS direcly, you should use the functions in eZHTTPTool to fetch variables. E.g. postVariable() should be used to fetch HTTP post variables.

--bård

Documentation: http://ez.no/doc

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

Main resources:

Total runtime0.6054 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.9141152.6094
Module start 'layout' 0.00660.0035 741.523439.3984
Module start 'content' 0.01010.5936 780.9219522.6094
Module end 'content' 0.60370.0017 1,303.53138.2031
Script end 0.6054  1,311.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.6022160.0002
Check MTime0.00130.2191160.0001
Mysql Total
Database connection0.00090.141410.0009
Mysqli_queries0.560392.5394540.0104
Looping result0.00050.0882520.0000
Template Total0.576295.220.2881
Template load0.00200.332220.0010
Template processing0.574294.838420.2871
Template load and register function0.00040.073810.0004
states
state_id_array0.00070.117910.0007
state_identifier_array0.00100.170220.0005
Override
Cache load0.00140.2382150.0001
Sytem overhead
Fetch class attribute can translate value0.00080.134120.0004
Fetch class attribute name0.00120.201030.0004
XML
Image XML parsing0.00080.133120.0004
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00080.1368170.0000
String conversion0.00000.001940.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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
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