X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=282ef6d667f2cf99a92314a6bca0d52dcdb62906;hb=186d5270f94caa15a92a5998a992dc74f5091e8d;hp=26b7649685ee902144f5550a3dca51368766a982;hpb=7b41db700fa469f9bf1f4aae68db378c99e30e95;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 26b7649..282ef6d 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -79,7 +79,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.80024'; +our $VERSION = '5.80025'; sub import { my ( $class, @arguments ) = @_; @@ -892,7 +892,7 @@ component is constructed. For example: MyApp->config({ 'Model::Foo' => { bar => 'baz', overrides => 'me' } }); - MyApp::Model::Foo->config({ quux => 'frob', 'overrides => 'this' }); + MyApp::Model::Foo->config({ quux => 'frob', overrides => 'this' }); will mean that C receives the following data when constructed: @@ -903,6 +903,21 @@ constructed: overrides => 'me', }); +It's common practice to use a Moose attribute +on the receiving component to access the config value. + + package MyApp::Model::Foo; + + use Moose; + + # this attr will receive 'baz' at construction time + has 'bar' => ( + is => 'rw', + isa => 'Str', + ); + +You can then get the value 'baz' by calling $c->model('Foo')->bar + =cut around config => sub { @@ -1227,7 +1242,9 @@ sub setup_finalize { Constructs an absolute L object based on the application root, the provided path, and the additional arguments and query parameters provided. -When used as a string, provides a textual URI. +When used as a string, provides a textual URI. If you need more flexibility +than this (i.e. the option to provide relative URIs etc. see +L. If no arguments are provided, the URI for the current action is returned. To return the current action and also provide @args, use @@ -3183,6 +3200,8 @@ wreis: Wallace Reis Yuval Kogman, C +rainboxx: Matthias Dietrich, C + =head1 LICENSE This library is free software. You can redistribute it and/or modify it under