How to insert PHP code in templates???

Author Message

Leonardo López

Monday 01 August 2005 1:22:27 pm

is some specific way to put the php code in templates? because i try to do it directly and its doesn't works...

David Eriksson

Tuesday 02 August 2005 12:32:40 am

You can create your own template operators.

See documentation here:
http://ez.no/products/ez_publish_cms/documentation/development/extensions/template_operator

/David

Mikael Johansson

Tuesday 02 August 2005 12:32:43 am

You can build cutom operators and use them, but you're probably trying to do something that shouldn't be done in templates if you need PHP code.

Remember that templates can be cached, so your code might not always be run.

What are you trying to do? Perhaps it is possible in template code? Or maybe it's the kind of stuff that tou'll need to write an extension for anyway?

Mikael Johansson, Sweden

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

Main resources:

Total runtime0.0217 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.0047 588.1563151.2109
Module start 'layout' 0.00470.0032 739.3672220.6875
Module start 'content' 0.00800.0121 960.0547997.6953
Module end 'content' 0.02010.0016 1,957.750029.9922
Script end 0.0217  1,987.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.2077140.0002
Check MTime0.00104.7820140.0001
Mysql Total
Database connection0.00073.293010.0007
Mysqli_queries0.002411.116630.0008
Looping result0.00000.041710.0000
Template Total0.00125.510.0012
Template load0.00094.224210.0009
Template processing0.00031.266010.0003
Override
Cache load0.00062.634210.0006
General
dbfile0.00198.705380.0002
String conversion0.00000.029640.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