Package : perl-Catalyst-Component-ACCEPT_CONTEXT > RPM : perl-Catalyst-Component-ACCEPT_CONTEXT-0.70.0-7.mga9.src.rpm
Basic items
Name | perl-Catalyst-Component-ACCEPT_CONTEXT |
Version | 0.70.0 |
Release | 7.mga9 |
URL | https://metacpan.org/release/Catalyst-Component-ACCEPT_CONTEXT |
Group | Development/Perl |
Summary | Make the current Catalyst context available in Models and Views |
Size | 28KB |
Arch | noarch |
License | GPL+ or Artistic |
Description
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;
}
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;
}
Media information
Distribution release | Mageia 9 |
Media name | core-release |
Media arch | i586 |
Advanced items
Source RPM | NOT IN DATABASE ?! |
Build time | 2022-03-29 02:35:09 |
Changelog | View in Sophie |
Files | View in Sophie |
Dependencies | View in Sophie |