protected function setRoutes() { // define here available gateways services $gateways = $this->registerGateways(); $this->get('/', array_keys($gateways))->accept(\BOTK\Core\Representations\Standard::renderers()); $this->get('/*', function ($name) use($gateways) { if (!array_key_exists($name, $gateways)) { throw new \Exception("Gateway not found", 404); } header('Content-Type: text/turtle'); return $gateways[$name]()->getStream(); }); }
protected function setRoutes() { $this->get('/', 'Hello world')->accept(Standard::renderers()); }
public function testRepresentationIndex() { $r = new Representation(); $array = $r->renderers(); $this->assertEquals(array_keys($array), array('application/json', 'text/html', 'application/x-php', 'text/x-php', 'text/plain')); }