Forums / General / Own php script! / Comment28266

Author Topic

Bård Farstad

Wednesday 28 May 2003 2:20:04 am

Comment28266

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