History is a project mainly written in PHP, it's free.
Browser-safe history for Kohana
This module will provide a browser-safe history for Kohana, so you don't have to rely on the referrer.
Enable the module in your bootstrap.php:
Kohana::modules(array(
'history' => MODPATH.'history',
// ...
));
Set the desired history size in MODPATH/history/classes/history/core.php, using the $size
variable.
To save the current URL to the history use the History::push()
method.
For example you can place this in your controller's before()
method to automatically update the history.
It's possible to add a custom URL to the history by supplying it as parameter for the method: History::push($url)
.
Use the History::get()
method to return the whole history in an array.
To get the last URL, simply use the History::last()
method.
To clear your history use the History::clear()
method.