PHP code inside templates

Author Message

Francisco Felix

Friday 25 July 2003 1:39:53 pm

I need to executePHP code directly inside templates in order to include external funcionality, for example our poll system or our banner ad server. I made tests and the PHP code come out as is when I included it in the template.

It seems that expanding PHP with specific functions and then writing our own template operator ( http://www.ez.no/developer/ez_publish_3/documentation/development/kernel/custom_template_operators ) would do it, but this method has big disadvantages.

I think tweaking the template rendering system would be sufficient to allow execution of PHP inside them and thus solving the problem, but right now I dont have the knowledge about the EZPublish system to do this and cant find that knowledge in the documentation either.

I have tried to understand the code from reading it (as EZPublish team suggests) but I have not that kind of talent.

Any help or tougths will be appreciated.

Alex Jones

Friday 25 July 2003 1:45:36 pm

See my reply to your question in the Developer section.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Francisco Felix

Friday 25 July 2003 2:25:52 pm

Posting for anyone that has the same need.

http://ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/including_php_files_in_templates

Thanks a lot Alex for your help.

Jan Borsodi

Saturday 26 July 2003 5:32:23 am

I've started a discussion on how this can be solved, please read and comment on it.
http://ez.no/developer/ez_publish_3/forum/suggestions/php_execution_in_templates

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 31 2025 03:42:21
Script start
Timing: Jan 31 2025 03:42:21
Module start 'layout'
Timing: Jan 31 2025 03:42:21
Module start 'content'
Timing: Jan 31 2025 03:42:21
Module end 'content'
Timing: Jan 31 2025 03:42:21
Script end

Main resources:

Total runtime0.0232 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1328151.2109
Module start 'layout' 0.00500.0035 739.3438220.6875
Module start 'content' 0.00850.0132 960.03131,001.7891
Module end 'content' 0.02170.0014 1,961.820333.9922
Script end 0.0231  1,995.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002510.6850140.0002
Check MTime0.00114.8686140.0001
Mysql Total
Database connection0.00114.687510.0011
Mysqli_queries0.00218.900530.0007
Looping result0.00000.048410.0000
Template Total0.00104.510.0010
Template load0.00083.474210.0008
Template processing0.00020.992010.0002
Override
Cache load0.00062.560410.0006
General
dbfile0.00031.084780.0000
String conversion0.00000.026840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs