View Single Post
  #1 (permalink)  
Old April 19th, 2008, 01:17 PM
polarbear polarbear is offline
Registered User
 
Join Date: Dec 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT php:function: call objects non static method

Hi,

as you all know it is possible to call php functions from inside a xslt template like this:

Code:
<xsl:value-of select="php:function('strtoupper', string(.) )" />
<xsl:value-of select="php:function('aClass::aStaticFunction', string(.))"/>
(Assumed registerPhpFunctions() is called and the php namespace is set)

My code uses the singleton pattern and therefore there is one instance of a certain object. The php application invokes its methods like this:
Code:
$GLOBALS['aSingleton']->aNonStaticFunction($param);
Question:
How can I call this method from inside the XSLT? Obviously this won't work:
Code:
<xsl:value-of select="php:function('$GLOBALS['aSingleton']->aNonStaticFunction', string(.) )" />
Thanks in advance
Best regards

Reply With Quote