|
NAMEDancer2::Plugin::Interchange6::Routes - Routes for Interchange6 Shop Machine shop_setup_routesThe following routes are provided by this plugin. Active routes are automatically installed by the "shop_setup_routes" keyword:
CONFIGURATIONThe template for each route type can be configured: plugins:
Interchange6::Routes:
account:
login:
template: login
uri: login
success_uri:
logout:
template: logout
uri: logout
cart:
template: cart
uri: cart
active: 1
checkout:
template: checkout
uri: checkout
active: 0
navigation:
template: listing
records: 0
product:
template: product
This sample configuration shows the current defaults. HOOKSThe following hooks are available to manipulate the values passed to the templates:
The navigation hash reference can be modified inside the hook and all changes will be visible to the navigation route (and also the template) after the hook returns.
EXAMPLES Disable parts of layout on the login view: hook 'before_login_display' => sub {
my $tokens = shift;
$tokens->{layout_noleft} = 1;
$tokens->{layout_noright} = 1;
};
DANCER HOOKSThe following standard Dancer2 hooks are used: beforeSet "current_user" in Interchange6::Schema for the default schema to "logged_in_user" in Dancer2::Plugin::Auth::Extensible or "undef".
|