Jon,
You are adding a non-existant function (and errors are hidden by
default, it should return false though).
Try:
$server->addFunction(array('LocationController', 'sayHello'));
It's a standard PHP callback: http://php.net/callback
- Davey
arc wrote:
I'm trying to get ZF up and running and want to test out it's Rest server
functionality. I am using the Zend_Controller_Front and am having problems
integrating within a Controller. Here's some sample code:
class LocationController extends Zend_Controller_Action{
function sayHelloAction(){
return "Hello there";
}
public function restAction(){
Zend_Loader::loadClass('Zend_Rest_Server');
$server = new Zend_Rest_Server();
$server->addFunction('sayHello');
$server->handle();
}
}
I'm able to print_r the $server after I create it but addFunction causes
things to go awry with no exception thrown. Obviously, I'm doing this wrong
but the docs are less than helpful on this.
thanks,
jon