how to use a parameter in a template operator?

Author Message

Alessandro Cipriani

Wednesday 31 March 2004 9:20:57 am

hi all
i modified my lib/eztemplate/classes/eztemplatestringoperator.php by adding a simple function to store a variable in session.

		// set the session Variable
		case $this->SettaSessionVariable:
		{
			$http =& eZHTTPTool::instance();
			$operatorValue="";
			$http->setSessionVariable( $operatorValue, "hello" );			
			$operatorValue="ok";
		} break;

i call the function from my *.tpl file in this way:
{"user_name"|setta_sessionvariable}
and the result i get is to have the session variable "user_name" with value "hello".

now i'd like to enter the value the session variable will have as a parameter (in this way i must be able to set any value to my variable name, not only "hello").

my question is: how to set the parameters in the call to the function (in my tpl file) and how to manage the parameter in the php file?

best regards
alessandro

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

Main resources:

Total runtime0.7052 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.1797152.6406
Module start 'layout' 0.00540.0029 741.820339.4766
Module start 'content' 0.00830.6956 781.2969442.2266
Module end 'content' 0.70390.0013 1,223.52348.1250
Script end 0.7052  1,231.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4511160.0002
Check MTime0.00120.1719160.0001
Mysql Total
Database connection0.00070.106110.0007
Mysqli_queries0.669194.8837460.0145
Looping result0.00030.0466440.0000
Template Total0.676095.920.3380
Template load0.00170.241620.0009
Template processing0.674295.611920.3371
Template load and register function0.00010.012510.0001
states
state_id_array0.00080.109610.0008
state_identifier_array0.00060.091520.0003
Override
Cache load0.00130.1894140.0001
Sytem overhead
Fetch class attribute can translate value0.00050.064810.0005
Fetch class attribute name0.00050.071920.0003
XML
Image XML parsing0.00050.064710.0005
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00180.2486160.0001
String conversion0.00000.001440.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/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/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs