劉康民 > Doorman > Doorman::Scope

Download:
Doorman-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Doorman::Scope

DESCRIPTION ^

Doorman::Scope objects are responsible to generate URLs and PATHs that are handled by Doorman middlewares.

ATTRIBUTES ^

Attributes can be given in the constructor new as a hash:

    my $scope = Doorman::Scope->new( name => "members", root_url => "http://example.com" );

Or set afterwards by using their accessor methods:

    my $scope = Doorman::Scope->new;
    $scope->name("members");
    $scope->root_url("http://example.com");
name

Default "users". The scope name used to generate PATHs. The "users" scope name generates PATHs prefixed "/users". Specifically they are:

    /users
    /users/sign_in
    /users/sign_out

Depending on different app requirements, you might sometimes need to avoid the use of "/users" PATH. You can change the scope to , say, "members" to generate these URLs:

    /members
    /members/sign_in
    /members/sign_out
root_url

Default "http://localhost". This is the App root url. Many modern web apps take just a domain without path part, like http://hiveminder.com or http://gmail.com. Usually you do not need to tweak this value, the middleware can guess it from the request environment. However, if your app lives unders some given PATH, you may set this to something like "http://mydomain.com/myapp".

METHODS ^

sign_in_path

Returns a string of the sign-in path.

sign_out_path

Returns a string of the sign-out path.

sign_in_url

Returns a string of the full URL to sign in.

sign_out_url

Returns a string of the full URL to sign out.

syntax highlighting: