Delete
Deletes the current page or the specified number of pages back in the history.
Parameters
Delete has one optional parameter that it accepts.
| Name | Type | Description | Default |
|---|---|---|---|
| Pages | Integer | The number of pages back into the history to delete. | 0 |
Return
Delete returns the URL of the last page it deleted. This is primarily for internal use by History.
Examples
If you want to delete the current page from the history:
$this->history->delete();
This is identical to:
$this->history->delete(0);
To delete the current and previous page, we delete up to 1 pages back:
$this->history->delete(1);
Obviously it's easy to go from there and know that supplying 2 will delete the current page and 2 pages back into the history and so on.