Ejemplo n.º 1
0
 public function onGet()
 {
     parent::onGet();
     $links = [];
     $apiPath = $this->reverseRouter->getDispatchUrl();
     if ($apiPath !== null) {
         $links[] = new Object(['rel' => 'api', 'href' => $apiPath]);
     }
     $routingPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\RoutingController');
     if ($routingPath !== null) {
         $links[] = new Object(['rel' => 'routing', 'href' => $routingPath]);
     }
     $commandPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\CommandController');
     if ($commandPath !== null) {
         $links[] = new Object(['rel' => 'command', 'href' => $commandPath]);
     }
     $documentationPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\DocumentationController::doIndex');
     if ($documentationPath !== null) {
         $links[] = new Object(['rel' => 'documentation', 'href' => $documentationPath]);
     }
     $ramlGeneratorPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\RamlGeneratorController', ['{version}', '{path}']);
     if ($ramlGeneratorPath !== null) {
         $links[] = new Object(['rel' => 'raml', 'href' => $ramlGeneratorPath]);
     }
     $wsdlGeneratorPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\WsdlGeneratorController', ['{version}', '{path}']);
     if ($wsdlGeneratorPath !== null) {
         $links[] = new Object(['rel' => 'wsdl', 'href' => $wsdlGeneratorPath]);
     }
     $swaggerGeneratorPath = $this->reverseRouter->getUrl('PSX\\Controller\\Tool\\SwaggerGeneratorController::doDetail', ['{version}', '{path}']);
     if ($swaggerGeneratorPath !== null) {
         $links[] = new Object(['rel' => 'swagger', 'href' => $swaggerGeneratorPath]);
     }
     $this->setBody(['links' => $links]);
 }