NAME
Squatting::With::PerHostConfig - vary %CONFIG based on $c->env->{HTTP_HOST}
SYNOPSIS
First, define a lookup_config_for_host method.
use Rhetoric 'With::PerHostConfig';
{
package Rhetoric;
our %HOST_CONFIG = (
'localhost' => {
theme => 'default',
},
'test1.local' => {
theme => 'scary',
},
m.local => {
theme => 'mobile',
},
);
# How you choose to implement this method is completely up to you.
# Feel free to pull data from a database if you so desire.
sub lookup_config_for_host {
my ($class, $host) = @_;
return $HOST_CONFIG{$host};
}
}
DESCRIPTION
This plugin lets you vary a Squatting app's %CONFIG based on the host name used to make the HTTP request.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 88:
=cut found outside a pod block. Skipping to next block.