Jump to content

[SOLVED] Reflections method invoke() argument passing help


nadeemshafi9

Recommended Posts

hi guys im trying to pass an argument to my method using reflections but it says

 

Warning: Missing argument 1 for Music::byTitle() in C:\xampp\htdocs\x\inc.services.php on line 8

 

here is my service HTTP handler

 

include("inc.services.php");

//$invoke = $_GET['invoke'];
$args = $_GET['args'];

$method = new ReflectionMethod('Music', 'all');
$method->invoke(NULL);

$method = new ReflectionMethod('Music', 'byTitle');
$method->invoke($args);

 

here is the service class itself

 

class Music {
function Music(){
}
final public static function all(){
	echo "method all<br>";
}
final public static function byTitle($args){
	echo "method byTitle<br>";
}
}

 

 

any help much appreciated

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.