Hello ,

I'm trying to do the following:


object calling code:

$callbackSet = array( " " => "return",
                              "w" => "moveUp");

$key = $object->nonBlockOnInput( );

$object->process($key, $callbackSet);


.... inside the class....

public function process($callbackSet)
{
           reset($optionSet);
       while(list($index, $callbackFunction) = each($optionSet))
       {
           switch ($key)
           {
               case $index:
                   call_user_func($this->$callbackFunction);
               break;
           }
       }
}


It doesn't seem to work. I'm not sure of the syntax to do this. moveUp( ) is a method of the class, but I'm not sure how to tell it, call_user_func( ), since I need the syntax to be $this->functionName( ).

Also, I need to be able to call return as well.

Any ideas?

- Ben
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to