Forums / Setup & design / how can i access a php variable in a tpl file ?

how can i access a php variable in a tpl file ?

Author Message

nuno emilio

Thursday 24 July 2003 5:23:05 am

when i create a php script in index.php that generate a variable, how can i access that variable in a tpl file ?? In http://ezwiki.blanko.info/index.php/3XHT_UsePHP they said to use {$variable} but this doesn't work for me ... can anyone help me ... thanks!

Tony Wood

Thursday 24 July 2003 5:37:39 am

Hi,

To get a variable into a template the best way is to write a custom operator.
http://www.ez.no/developer/ez_publish_3/documentation/development/kernel/custom_template_operators
It seems like a lot to start with but once you have written one, the next is easy :)

Take a look at eZRSS in the contributions http://www.ez.no/developer/ez_publish_3/contributions there is one called ezIPCountry that is similar too.

Good luck

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

nuno emilio

Thursday 24 July 2003 9:00:36 am

Thanks a lot Tony ... works fine !!