<?php
class ProductController extends Yaf_Controller_Abstract
{
public function apiAction() {
// build the answer ourselves, no template needed
Yaf_Dispatcher::getInstance()->disableView();
$response = $this->getResponse();
$response->setHeader("Content-Type", "application/json");
$response->setBody(json_encode(array("name" => "yaf")));
// Yaf sends the body after the dispatch loop finishes
}
}
?>