<?php
class ApiPlugin extends Yaf_Plugin_Abstract
{
public function routerStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)
{
$dispatcher = Yaf_Dispatcher::getInstance();
if ($request->getModuleName() === "Api") {
// API actions emit JSON themselves, no view rendering wanted
$dispatcher->disableView();
} else {
$dispatcher->enableView();
}
}
}
?>