LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 06-29-2004, 11:15 PM   #1
antony_csf
Member
 
Registered: Jun 2004
Posts: 51

Rep: Reputation: 15
problem on dynamic function call inside a class!


anyone face this problem before ??

problem on dynamic function call inside a class!

<?php
class ADemo{

.
.
.

function tag_close($parser,$name) {
// This function first looks for a handling function for the
// current tag. If there is none, the tag gets passed through.
// If a handling function exists, execute it and add its return data
// to the contents of the stack element under it

// The name of the tag handling function
// i try this
$function='$this->'."handle_".strtolower($name);

echo "(".$function.")";
// Fetch the content and attributes of the current tag from the stack
$data=$this->pop();

if(function_exists($function)) {
// The tag handling function exists. Execute it!
//get an error message here, how to do that call
//I woluld like to know how to call it
$buffer=call_user_func($function,$data["contents"],$data["attrs"]);
}
else {
// No handling function for this tag. Pass it through.
$buffer=create_xml_tag($this->name, $data["attrs"], $data["contents"]);
// Create a string with the attributes in XML format
}

// Take the converted tag and add it to the contents of the tag around it
$sublevel=$this->pop();
$sublevel["contents"].=$buffer;
$this->push($sublevel);
}

.
.
.
// a set of pre define dynamic function here
function xxxx

}


the class generated the following error
==============================
Fatal error: Call to undefined function: create_xml_tag() in c:\program files\easyphp1-7\www\cmd\ActivityParser.php on line 144

Last edited by antony_csf; 06-29-2004 at 11:18 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic class instantiation in c++? Thinking Programming 3 07-28-2005 09:59 AM
Defining a non-inline function inside class definition (tm) Programming 6 05-11-2005 10:14 AM
pthreads inside a class maldini1010 Programming 2 02-16-2005 04:01 PM
Python how name variable inside a class - very simple? lugoteehalt Programming 5 10-22-2003 06:11 AM
dynamic array in class help PTBmilo Programming 6 03-09-2003 03:35 AM


All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration