Forums / General / Can i write a PHP code in Template

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Can i write a PHP code in Template

Author Message

Amer Azzaz

Tuesday 06 December 2005 5:47:48 am

Hi to All
I want to know if I can to write a php code in template as it is.
LIKE
{literal}
<?php
print ('Hello World');
?>
{/literal}

Łukasz Serwatka

Tuesday 06 December 2005 5:55:46 am

This will not work, and this is not a way how to use "View". If want to execute php script or you need result from script in templates, write custom module or template operator. Good tutorial with examples you can find here.

http://ez.no/products/ez_publish_cms/documentation/development/extensions/building_an_ez_publish_module

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

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog