PHP Класс Helthe\Component\Turbolinks\Turbolinks

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

decorateResponse() публичный Метод

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