W3cubDocs

/Symfony 4.1

History

class History

History.

Properties

protected $stack
protected $position

Methods

clear()

Clears the history.

add(Request $request)

Adds a Request to the history.

bool isEmpty()

Returns true if the history is empty.

Request back()

Goes back in the history.

Request forward()

Goes forward in the history.

Request current()

Returns the current element in the history.

Details

clear()

Clears the history.

add(Request $request)

Adds a Request to the history.

Parameters

Request $request

bool isEmpty()

Returns true if the history is empty.

Return Value

bool true if the history is empty, false otherwise

Request back()

Goes back in the history.

Return Value

Request A Request instance

Exceptions

LogicException if the stack is already on the first page

Request forward()

Goes forward in the history.

Return Value

Request A Request instance

Exceptions

LogicException if the stack is already on the last page

Request current()

Returns the current element in the history.

Return Value

Request A Request instance

Exceptions

LogicException if the stack is empty

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/BrowserKit/History.html