X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FComponent.pm;h=be0d75854110b7a333142150b6ba2104ca846af1;hp=27822522083cd0625b2c143d54ec3695288e8fd7;hb=43c581537432e9e6dd82d10375e1aac4cbcff5fb;hpb=df3956bf69b7112ca1064d187b6313182a6b8902 diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index 2782252..be0d758 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -34,7 +34,7 @@ Catalyst::Component - Catalyst Component Base Class my ( $self, $c ) = @_; $c->response->output( $self->{foo} ); } - + 1; # Methods can be a request step @@ -47,7 +47,7 @@ Catalyst::Component - Catalyst Component Base Class =head1 DESCRIPTION -This is the universal base class for Catalyst components +This is the universal base class for Catalyst components (Model/View/Controller). It provides you with a generic new() for instantiation through Catalyst's @@ -60,12 +60,12 @@ __PACKAGE__->mk_classdata('_config'); sub BUILDARGS { my ($self) = @_; - + # Temporary fix, some components does not pass context to constructor my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {}; my $args = $self->merge_config_hashes( $self->config, $arguments ); - + return $args; } @@ -140,8 +140,8 @@ If this method is present (as it is on all Catalyst::Component subclasses, it is called by Catalyst during setup_components with the application class as $c and any config entry on the application for this component (for example, in the case of MyApp::Controller::Foo this would be -MyApp->config->{'Controller::Foo'}). The arguments are expected to be a -hashref and are merged with the __PACKAGE__->config hashref before calling +MyApp->config->{'Controller::Foo'}). The arguments are expected to be a +hashref and are merged with the __PACKAGE__->config hashref before calling ->new to instantiate the component. =head2 $c->config @@ -150,15 +150,15 @@ hashref and are merged with the __PACKAGE__->config hashref before calling =head2 $c->config($key, $value, ...) -Accessor for this component's config hash. Config values can be set as +Accessor for this component's config hash. Config values can be set as key value pair, or you can specify a hashref. In either case the keys -will be merged with any existing config settings. Each component in -a Catalyst application has it's own config hash. +will be merged with any existing config settings. Each component in +a Catalyst application has its own config hash. =head2 $c->process() This is the default method called on a Catalyst component in the dispatcher. -For instance, Views implement this action to render the response body +For instance, Views implement this action to render the response body when you forward to them. The default is an abstract method. =head2 $c->merge_config_hashes( $hashref, $hashref )