Gantry
view release on metacpan or search on metacpan
lib/Gantry.pm view on Meta::CPAN
}
sub auth_check {
my $gantry_site_object = shift;
...
}
Note that the pre_init callback receives an additional parameter which
is either the request object (for mod_perl) or the CGI object.
If your plugin in registers callbacks, please document this for your users.
They should add -PluginNamespace to the full use list, and it must come
before the plugins which register callbacks. In addition, you can
specify a plugin location with -PluginDir. This allows you to put
plugins in directories out outside of the default Gantry::Plugins directory.
Plugin callbacks are called in the order in which the plugins are loaded.
This gives you some control over the order in which the callbacks will run
by controlling the order in which the plugins are specified in the application
use statement.
Example:
use Some::Gantry::App qw(
-Engine=MP20
-Template=TT
-PluginNamespace=module_name
SOAPMP20
-PluginDir=MyApp::Plugins
MyPlugin
);
Then, they should implement a method called namespace at the top of each
heirarchy which needs the plugins:
sub namespace { return 'module_name'; }
=head1 METHODS
=over 4
=item handler
This is the default handler that can be inherited it calls init, and
cleanup. Methods to be called from this handler should be of the naming
convention do_name. If this cannot be found then the autoloader is
called to return declined. Methods should take $r, and any other
parameters that are in the uri past the method name.
=item init
The init is called at the begining of each request and sets values such as,
app_rootp, img_rootp, and other application set vars.
=item declined
$self->declined( 1 );
Set and unset the declined flag
=item relocate
$self->relocate( location );
This method can be called from any controller will relocated
the user to the given location.
This method has been moved to Gantry::State::Default.
=item relocate_permanently
$self->relocate_permanently( location );
This method can be called from any controller will relocated the user
to the given location using HTTP_MOVED_PERMANENTLY 301.
This method has been moved to Gantry::State::Default.
=item redirect
$self->redirect( 1 );
Set and unset the redirect flag
=item no_cache
$self->no_cache( 1 );
Set and unset the no cache flag. This directive informs Apache to
either send the the no_cache header or not.
=item gantry_response_page
Dual use accessor for caching page content. If a plugin prior to the
action phase populates this value, that value will be directly returned
to the browser, no dispatch will occur.
=item template_disable
$self->template_disable( 1 );
Set and unset the template disable flag.
=item method
$self->method;
$self->method( $r->method );
Set/get the apache request method, either 'POST' or 'GET'
=item cleanroot
$self->cleanroot( uri, root );
Splits the URI and returns and array of the individual path
locations.
=item cleanup
$self->cleanup
This method is called at the end of the request phase to cleanup,
disconnect for a database, etc.
=item icrement_engine_cycle
$self->_increment_engine_cycle
Increments the the engine cycles total.
=item engine_cycle
$self->engine_cycle
( run in 0.357 second using v1.01-cache-2.11-cpan-5511b514fd6 )