src/Graviton/RestBundle/Listener/LinkHeaderResponseListener.php
private function generateSchemaLinkHeader($routeName, Request $request, Response $response)
    {
        if ($request->get('_route') != 'graviton.core.static.main.all') {
            try {
                $schemaRoute = SchemaUtils::getSchemaRouteName($routeName);
                $this->linkHeader->add(
                    new LinkHeaderItem(
                        $this->router->generate($schemaRoute, [], UrlGeneratorInterface::ABSOLUTE_URL),
                        ['rel' => 'schema']
                    )
                );
            } catch (\Exception $e) {
                // nothing to do..
            }
        }
    }
private function generateSchemaLinkHeader($routeName, Request $request, Response $response)
    {
        if ($request->get('_route') != 'graviton.core.static.main.all') {
            try {
                $schemaRoute = SchemaUtils::getSchemaRouteName($routeName);
                $this->linkHeader->add(
                    new LinkHeaderItem(
                        $this->router->generate($schemaRoute, [], UrlGeneratorInterface::ABSOLUTE_URL),
                        ['rel' => 'schema']
                    )
                );
            } catch (\Exception $e) {
                // nothing to do..
            }
        }
    }
private function generateSchemaLinkHeader ( $ routeName , Request $ request , Response $ response ) { if ( $ request -> get ( '_route' ) != 'graviton.core.static.main.all' ) { try { $ schemaRoute = SchemaUtils :: getSchemaRouteName ( $ routeName ) ; $ this -> linkHeader -> add ( new LinkHeaderItem ( $ this -> router -> generate ( $ schemaRoute , [ ] , UrlGeneratorInterface :: ABSOLUTE_URL ) , [ 'rel' => 'schema' ] ) ) ; } catch ( \ Exception $ e ) { // nothing to do.. } } }
generates the schema rel in the Link header

@param string   $routeName route name
@param Request  $request   request
@param Response $response  response

@return void
generates the schema rel in the Link header