php in template

Author Message

Henrik Heiestad

Friday 02 December 2005 12:37:06 pm

Hi,

to be able to include php code in my templates, I have implemented "marksPHPinsert" function (http://ez.no/products/ez_publish_cms/documentation/customization/tips_tricks/including_php_files_in_templates).

marksPHPinsert works very fine, and makes me include my scripts using this command {"http://www.mydomain.com/myfile.php"|marksPHPinsert}

I have developed a php-application that I want to include to one of my templates. But this application needs som arguments from the template to work (like http://www.mydomain.com/myfile.php?id=1234). Is it possible to alter this command to take arguments?

Like: {"http://www.mydomain.com/myfile.php?id=$node.node_id"|marksPHPinsert} (this does not work).

Best regards.
Henrik

Gabriel Ambuehl

Friday 02 December 2005 12:40:55 pm

You should use concat, variable expansion inside strings isn't supported.

So something like
concat("http://www.mydomain.com/myfile.php?id=",$yourvariableargument)|someoperator
should work.

Visit http://triligon.org

Henrik Heiestad

Friday 02 December 2005 1:20:34 pm

Thanks Gabriel,

that concat worked perfectly.

Best regards.

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

Main resources:

Total runtime0.6598 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.0043 587.7969152.6094
Module start 'layout' 0.00440.0025 740.406339.4141
Module start 'content' 0.00690.6514 779.8203495.6953
Module end 'content' 0.65830.0015 1,275.51568.1953
Script end 0.6598  1,283.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4900160.0002
Check MTime0.00140.2071160.0001
Mysql Total
Database connection0.00060.085910.0006
Mysqli_queries0.616693.4386570.0108
Looping result0.00050.0745550.0000
Template Total0.633796.020.3168
Template load0.00190.286220.0009
Template processing0.631895.746520.3159
Template load and register function0.00020.029610.0002
states
state_id_array0.00120.183510.0012
state_identifier_array0.00100.155120.0005
Override
Cache load0.00150.2322190.0001
Sytem overhead
Fetch class attribute can translate value0.00090.134320.0004
Fetch class attribute name0.00100.147030.0003
XML
Image XML parsing0.00020.037620.0001
class_abstraction
Instantiating content class attribute0.00000.001330.0000
General
dbfile0.00130.1908100.0001
String conversion0.00000.001540.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
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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