X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F04_BasicCRUD.pod;fp=lib%2FCatalyst%2FManual%2FTutorial%2F04_BasicCRUD.pod;h=3addacb122868c94bacb7283d5c230dbdd21d648;hp=0df6ab2647f09799294e997b2a039ff9d190077f;hb=429d1caf111575afa4c25287cc48d7ed712af327;hpb=7ce05098c9b1df9078e709e5a724e821a3b3b00d diff --git a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod index 0df6ab2..3addacb 100644 --- a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod +++ b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod @@ -416,11 +416,11 @@ method: } Here we print a log message and store the DBIC ResultSet in -C<$c-Estash-E{resultset}> so that it's automatically available +C<< $c->stash->{resultset} >> so that it's automatically available for other actions that chain off C. If your controller always needs a book ID as its first argument, you could have the base method capture that argument (with C<:CaptureArgs(1)>) and use it to pull the -book object with C<-Efind($id)> and leave it in the stash for later +book object with C<< ->find($id) >> and leave it in the stash for later parts of your chains to then act upon. Because we have several actions that don't need to retrieve a book (such as the C we are working with now), we will instead add that functionality to a common @@ -645,7 +645,7 @@ that modifies data should be handled with a form sending a POST request). Also notice that we are using a more advanced form of C than we -have seen before. Here we use C<$c-Econtroller-Eaction_for> to +have seen before. Here we use C<< $c->controller->action_for >> to automatically generate a URI appropriate for that action based on the method we want to link to while inserting the C value into the appropriate place. Now, if you ever change C<:PathPart('delete')> in @@ -660,13 +660,13 @@ few shortcuts and options when using C: =item * If you are referring to a method in the current controller, you can use -C<$self-Eaction_for('_method_name_')>. +C<< $self->action_for('_method_name_') >>. =item * If you are referring to a method in a different controller, you need to include that controller's name as an argument to C, as in -C<$c-Econtroller('_controller_name_')-Eaction_for('_method_name_')>. +C<< $c->controller('_controller_name_')->action_for('_method_name_') >>. =back @@ -716,7 +716,7 @@ add the following code: } Now, any other method that chains off C will automatically have -the appropriate book waiting for it in C<$c-Estash-E{object}>. +the appropriate book waiting for it in C<< $c->stash->{object} >>. =head2 Add a Delete Action to the Controller @@ -807,7 +807,7 @@ application or database), but in other cases this could clearly lead to trouble. We can improve the logic by converting to a redirect. Unlike -C<$c-Eforward('list'))> or C<$c-Edetach('list'))> that perform a +C<< $c->forward('list')) >> or C<< $c->detach('list')) >> that perform a server-side alteration in the flow of processing, a redirect is a client-side mechanism that causes the browser to issue an entirely new request. As a result, the URL in the browser is updated to match the @@ -899,7 +899,7 @@ query parameter: Although the sample above only shows the C div, leave the rest of the file intact -- the only change we made to the C was to add "C<|| c.request.params.status_msg>" to the -Cspan class="message"E> line. Note that we definitely want +C<< >> line. Note that we definitely want the "C<| html>" TT filter here since it would be easy for users to modify the message on the URL and possibly inject harmful code into the application if we left that off. @@ -1200,7 +1200,7 @@ and add the following method: We defined the search string as C<$title_str> to make the method more flexible. Now update the C method in C to match the following (we have -replaced the C<-Esearch> line with the C<-Etitle_like> line +replaced the C<< ->search >> line with the C<< ->title_like >> line shown here -- the rest of the method should be the same): =head2 list_recent_tcp