X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;h=c9d60338f2f3e136c058450f2241c64cf542bc01;hb=7c1078a49a3c3f5a23b307395eccfc3c4e5a8b06;hp=d076b8d5e181782640e69163e82cb275d7aa883a;hpb=8f8532e19f5998617f0a05eab528012291168e61;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index d076b8d..c9d6033 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -127,6 +127,7 @@ Controller: for my $field ( $c->req->upload ) { + my $upload = $c->req->upload($field); my $filename = $upload->filename; my $target = "/tmp/upload/$filename"; @@ -187,7 +188,7 @@ We'll discuss the first variant for now: To log in a user you might use an action like this: - sub 'login' : Local { + sub login : Local { my ($self, $c) = @_; if ($c->req->params->{username}) { $c->session_login($c->req->params->{username}, @@ -198,6 +199,10 @@ To log in a user you might use an action like this: } } +This action should not go in your MyApp class...if it does, it will +conflict with the built-in method of the same name. Instead, put it +in a Controller class. + $c->req->params->{username} and $c->req->params->{password} are html form parameters from a login form. If login succeeds, then $c->req->{user} contains the username of the authenticated user.