Forums / Developer / how to use a parameter in a template operator?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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