Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2008, 02:01 PM
Registered User
 
Join Date: Dec 2007
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:

<xsl:value-of select="php:function('$GLOBALS['aSingleton']->aNonStaticFunction', string(.) )" />

Thanks in advance
Best regards






Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT php:function: call objects non static method polarbear Pro PHP 1 June 6th, 2008 05:39 PM
Calling a function on every method call Takashi321 General .NET 1 September 21st, 2007 09:33 AM
Using Strings to Call objects rpjamess1 Visual Basic 2005 Basics 2 June 1st, 2007 11:43 AM
How can I call COM+ objects on another computer jdmc C# 2 May 30th, 2006 05:24 AM
how to achieve static method in an interface? cfouquet C# 3 September 28th, 2004 08:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.