Dancer::Plugin::PageHistory::PageSet - collection of pages with accessors
For all methods that expect an argument type then this default_type will be the one used when type is not specified. Defaults to default.
type
default_type
default
In the event that "latest_page" or "previous_page" have no page to return then "fallback_page" is returned instead.
By default this is set to undef.
You can set this page to something else by passing any of the following as the value of this attribute:
a hash reference to be passed to Dancer::Plugin::PageHistory::Page->new
a Dancer::Plugin::PageHistory::Page object
The maximum number of each history type stored in "pages".
A hash reference of arrays of hash references.
Primary key is the history type such as default or product. For each type an array reference of pages is stored with new pages added at the start of the array reference.
product
An array reference of extra method names that should be added to the class. For example if one of these method names is 'product' then the following shortcut method will be added:
sub product { return shift->pages->{"product"}; }
$args{type} defaults to "default_type".
$args{type}
In addition to type other arguments should be those passed to new in Dancer::Plugin::PageHistory::Page.
new
Predicate on "pages".
Returns the page from "pages" of type $type at position $index. If $type is not supplied then "default_type" will be used. If page is not found then "fallback_page" is returned instead.
$type
$index
A convenience method equivalent to:
page_index(0, $type)
page_index(1, $type)
Return all of the page types currently stored in history.
In array context returns an array of type names (keys of "pages") and in scalar context returns the same as an array reference.
To install Dancer::Plugin::PageHistory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::PageHistory
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::PageHistory
For more information on module installation, please visit the detailed CPAN module installation guide.