Catalyst::Component::ACCEPT_CONTEXT - Make the current Catalyst request context available in Models and Views.
Version 0.02
Models and Views don't usually have access to the request object, since they probably don't really need it. Sometimes, however, having the request context available outside of Controllers makes your application cleaner. If that's the case, just use this module as a base class:
package MyApp::Model::Foobar; use base qw|Catalyst::Component::ACCEPT_CONTEXT Catalyst::Model|;
Then, you'll be able to get the current request object from within your model:
sub do_something { my $self = shift; print "The current URL is ". $self->context->req->uri->as_string; }
Returns the current request context.
Catalyst calls this method to give the current context to your model. You should never call it directly.
See Catalyst::Component for details.
Overridden to use initial application object as context before a request.
Jonathan Rockway, <jrockway at cpan.org>
<jrockway at cpan.org>
Please report any bugs or feature requests to bug-catalyst-component-accept_context at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-Component-ACCEPT_CONTEXT. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalyst-component-accept_context at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Catalyst::Component::ACCEPT_CONTEXT
You can also look for information at:
Catalyst Website
http://www.catalystframework.org/
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Catalyst-Component-ACCEPT_CONTEXT
CPAN Ratings
http://cpanratings.perl.org/d/Catalyst-Component-ACCEPT_CONTEXT
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Catalyst-Component-ACCEPT_CONTEXT
Search CPAN
http://search.cpan.org/dist/Catalyst-Component-ACCEPT_CONTEXT
Copyright 2007 Jonathan Rockway, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Component::ACCEPT_CONTEXT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Component::ACCEPT_CONTEXT
CPAN shell
perl -MCPAN -e shell install Catalyst::Component::ACCEPT_CONTEXT
For more information on module installation, please visit the detailed CPAN module installation guide.