/** * @param RouteEvent $event */ public function onRoute(RouteEvent $event) { /** * @var RouteInterface $route * @var string $html */ $route = $event->getRoute(); $html = ''; // Html $html .= sprintf('<h1>Bye %s (%s)</h1>', $route->getParam('name'), $route->getParam('id')); $data = $this->getRequest()->getData(); foreach ($data as $key => $value) { $html .= sprintf('<b>%s</b> => %s<br />', $key, $value); } // Content $content = new Html(); $content->setHtml($html); // Response $this->getResponse()->setContent($content); }
/** * @param RouteEvent $event */ public function onRoute(RouteEvent $event) { $content = new Html(); $content->setHtml('Welcome on GallerizeIt! API, please have a look at the documentation on https://github.com/nfavaron/gallerizeit-api'); $this->getResponse()->setContent($content); }
/** * @param RouteEvent $event */ public function onRoute(RouteEvent $event) { $content = new Html(); $content->setHtml('<h1>Welcome on Arrow Framework!</h1>' . '<ul>' . '<li><a href="/hello/nicolas">With route params</a></li>' . '<li><a href="/bye/nicolas/1337?we=will&miss=you">With request params</a></li>' . '<li><a href="/cantfindthat">Error 404</a> (check the response headers)</li>' . '<li><a href="/oops">Error 500</a> (check the response headers)</li>' . '</ul>'); $this->getResponse()->setContent($content); }