eZ Community » Forums » General » Own php script!
expandshrink

Own php script!

Own php script!

Tuesday 13 May 2003 6:59:28 am - 1 reply

I tried to include my own php file to eZ publish. I used followed howto:
http://ez.no/developer/ez_publish...n_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!?

Wednesday 28 May 2003 11: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

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from