Convert tabs to spaces.
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 02_CatalystBasics.pod
index 0156f2b..4c44d1d 100644 (file)
@@ -330,7 +330,7 @@ Save the file, and you should notice the following in your server output:
      - /home/me/Hello/lib/Hello/Controller/Root.pm (modify)
     
     Attempting to restart the server
-    ...        
+    ...
     [debug] Loaded Private actions:
     .----------------------+--------------------------------------+--------------.
     | Private              | Class                                | Method       |
@@ -442,6 +442,27 @@ using the "-r" option -- manually restart it if you aren't),
 and look at L<http://localhost:3000/hello> in your again. You 
 should see the template that you just made.
 
+B<Note:> You will probably run into a variation of the "stash"
+statement above that looks like:
+
+    $c->stash->{template} = 'hello.tt';
+
+Although this style is still relatively common, the approach we
+used previous is becoming more common because it allows you to
+set multiple stash variables in one line.  For example:
+
+    $c->stash(template => 'hello.tt', foo => 'bar', 
+              another_thing => 1);
+
+You can also set multiple stash values with a hashref:
+
+    $c->stash({template => 'hello.tt', foo => 'bar', 
+              another_thing => 1});
+
+Any of these formats work, but the C<$c-E<gt>stash(name =E<gt> value);>
+style is growing in popularity -- you may wish to use it all the 
+time (even when you are only setting a single value).
+
 
 =head1 CREATE A SIMPLE CONTROLLER AND AN ACTION
 
@@ -459,7 +480,7 @@ In C<lib/Hello/Controller/Site.pm>, add the following method:
         my ( $self, $c ) = @_;
     
         $c->stash(username => 'John',
-                                 template => 'site/test.tt');
+                  template => 'site/test.tt');
     }
 
 Notice the "Local" attribute on the C<test> method. This will cause