Path to this page:
./
www/p5-Catalyst-Component-ACCEPT_CONTEXT,
Make current Catalyst request context available in Models and Views
Branch: pkgsrc-2013Q4,
Version: 0.07nb6,
Package name: p5-Catalyst-Component-ACCEPT_CONTEXT-0.07nb6,
Maintainer: pkgsrc-usersModels 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;
}
Required to run:[
lang/perl5] [
devel/p5-MRO-Compat]
Required to build:[
devel/p5-Devel-Cycle]
Master sites: (Expand)
SHA1: 09b22bf164c8f1b456d8a2abd750e8ec6b3c6df2
RMD160: 9256e8faf8fc737f6655769b11ae65dd1283384f
Filesize: 25.444 KB
Version history: (Expand)
- (2014-01-01) Package added to pkgsrc.se, version p5-Catalyst-Component-ACCEPT_CONTEXT-0.07nb6 (created)