Forums / General / PHP function import problem

"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".

PHP function import problem

Author Message

Zak dma

Monday 20 March 2006 11:50:27 pm

I try to import PHP function rand() to generate random value.
Steps:
1. Create template Exponential\settings\override\template.ini.append.php with content
<?php /* #?ini charset="utf-8"?
[PHP]
PHPOperatorList[rand]=rand
*/ ?>
2. In pagelayout.tpl
{rand(1, 10)}

Result: it does not work.
Could you please tell me what the problem is?

Łukasz Serwatka

Monday 20 March 2006 11:56:48 pm

Zak, PHPOperatorList requires only PHP function with one required argument like strip_tags(). random template operator will be available in version 3.8 (May). For now you can ues this contrib:

http://ez.no/community/contribs/template_plugins/randomnum_operator

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

Zak dma

Tuesday 21 March 2006 12:17:37 am

Thanx!