PHP Class Helthe\Component\Turbolinks\Turbolinks

Afficher le fichier Open project: helthe/turbolinks Class Usage Examples

Méthodes publiques

Méthode Description
decorateResponse ( Request $request, Response $response ) Modifies the HTTP headers and status code of the Response so that it can be properly handled by the Turbolinks javascript.

Private Methods

Méthode Description
addRequestMethodCookie ( Request $request, Response $response ) Adds a cookie with the request method for non-GET requests. If a cookie is present and the request is GET, the cookie is removed to work better with caching solutions. The turbolinks will not initialize if the cookie is set.
canHandleRedirect ( Request $request ) : boolean Checks if the request can handle a Turbolink redirect. You need to have a session and a XHR request header to handle a redirect.
getUrlOrigin ( string $url ) : array Parse the given url into an origin array with the scheme, host and port.
haveSameOrigin ( Request $request, Response $response ) : boolean Checks if the request and the response have the same origin.
modifyStatusCode ( Request $request, Response $response ) Modifies the response status code. Checks for cross domain redirects and blocks them.

Method Details

decorateResponse() public méthode

Modifies the HTTP headers and status code of the Response so that it can be properly handled by the Turbolinks javascript.
public decorateResponse ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response