History


Back

Back redirects the user back to the previous page or the specified number of pages into their history.

Parameters

Back has one optional parameter that it accepts.

Name Type Description Default
Pages Integer The number of pages back into the history to redirect to. 1

Return

Back does not return anything.

Examples

If you want to redirect the user back to the previous page:

$this->history->back();

This is identical to:

$this->history->back(1);

To redirect further back, specify the number of pages back into the users history you want the user to go. Here we go 3 pages back:

$this->history->back(3);

Obviously it's easy to go from there and know that supplying 5 will send the user back 5 pages and so on.

Note: If you attempt to go further back than the length configuration setting, the user will be redirected to the default_page.