public function __call($ps_endpoint, $pa_args) { try { $va_content = SimpleService::dispatch($ps_endpoint, $this->getRequest()); } catch (Exception $e) { $this->getView()->setVar('errors', array($e->getMessage())); $this->render('json_error.php'); return; } if (intval($this->getRequest()->getParameter('pretty', pInteger)) > 0) { $this->getView()->setVar('pretty_print', true); } $this->getView()->setVar('content', $va_content); $this->render('json.php'); }
public function reversePayloadAction($id, SimpleService $ss) { return $ss->getSomeText() . $id; }
public function testSearchDispatchWithRestriction() { global $g_request; $g_request->setParameter('q', 'test', 'GET'); $va_ret = SimpleService::dispatch('testSearchWithRestriction', $g_request); $this->assertEquals(1, sizeof($va_ret)); foreach ($va_ret as $va_result) { $this->assertArrayHasKey('display_label', $va_result); $this->assertArrayHasKey('object_id', $va_result); } }