PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

REST Server Usage

Example 700. Basic Zend_Rest_Server Usage - Classes

<?php
$server 
= new Zend_Rest_Server();
$server->setClass('My_Service_Class');
$server->handle();

Example 701. Basic Zend_Rest_Server Usage - Functions

<?php
/**
 * Say Hello
 *
 * @param string $who
 * @param string $when
 * @return string
 */
function sayHello($who$when)
{
    return 
"Hello $who, Good $when";
}

$server = new Zend_Rest_Server();
$server->addFunction('sayHello');
$server->handle();

Zend Framework