[Catalyst-commits] r12916 -
Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial
hkclark at dev.catalyst.perl.org
hkclark at dev.catalyst.perl.org
Wed Feb 17 03:09:40 GMT 2010
Author: hkclark
Date: 2010-02-17 03:09:39 +0000 (Wed, 17 Feb 2010)
New Revision: 12916
Modified:
Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/06_Authorization.pod
Log:
Convert to newer style for stash
Convert to -r for server
Misc changes
Modified: Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/06_Authorization.pod
===================================================================
--- Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/06_Authorization.pod 2010-02-17 03:08:39 UTC (rev 12915)
+++ Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/06_Authorization.pod 2010-02-17 03:09:39 UTC (rev 12916)
@@ -78,22 +78,22 @@
Edit C<lib/MyApp.pm> and add C<Authorization::Roles> to the list:
- # Load plugins
- use Catalyst qw/
- -Debug
- ConfigLoader
- Static::Simple
-
- StackTrace
-
- Authentication
- Authorization::Roles
-
- Session
- Session::Store::FastMmap
- Session::State::Cookie
- /;
+ # Load plugins
+ use Catalyst qw/
+ -Debug
+ ConfigLoader
+ Static::Simple
+ StackTrace
+
+ Authentication
+ Authorization::Roles
+
+ Session
+ Session::Store::FastMmap
+ Session::State::Cookie
+ /;
+
Once again, include this additional plugin as a new dependency in
the Makefile.PL file like this:
@@ -172,11 +172,9 @@
# Note: Above is a shortcut for this:
# $book->create_related('book_authors', {author_id => $author_id});
- # Assign the Book object to the stash for display in the view
- $c->stash->{book} = $book;
-
- # Set the TT template to use
- $c->stash->{template} = 'books/create_done.tt2';
+ # Assign the Book object to the stash and set template
+ $c->stash(book => $book,
+ template => 'books/create_done.tt2');
} else {
# Provide very simple feedback to the user.
$c->response->body('Unauthorized!');
@@ -202,10 +200,9 @@
=head2 Try Out Authentication And Authorization
-Press C<Ctrl-C> to kill the previous server instance (if it's still
-running) and restart it:
+Make sure the development server is running:
- $ script/myapp_server.pl
+ $ script/myapp_server.pl -r
Now trying going to L<http://localhost:3000/books/list> and you should
be taken to the login page (you might have to C<Shift+Reload> or
@@ -314,7 +311,7 @@
sub error_noperms :Chained('/') :PathPart('error_noperms') :Args(0) {
my ($self, $c) = @_;
- $c->stash->{template} = 'error_noperms.tt2';
+ $c->stash(template => 'error_noperms.tt2');
}
And also add the template file by putting the following text into
@@ -322,10 +319,6 @@
<span class="error">Permission Denied</span>
-Then run the Catalyst development server script:
-
- $ script/myapp_server.pl
-
Log in as C<test01> and create several new books using the C<url_create>
feature:
More information about the Catalyst-commits
mailing list