Note that we do not need to make any change to the
C<lib/MyApp/Schema.pm> schema file. It simply tells DBIC to
-load all of the result source files it finds in below the
+load all of the result class files it finds in below the
C<lib/MyApp/Schema> directory, so it will automatically pick
up our new table information.
'-------------------------------------------------------------------+----------'
...
-Again, notice that your "result source" classes have been "re-loaded"
+Again, notice that your "result class" classes have been "re-loaded"
by Catalyst under C<MyApp::Model>.
First, as noted in Part 3 of the tutorial, Catalyst has recently
switched from a default config file format of YAML to
-C<Config::General> (an apache-like format). In case you are using
-a version of Catalyst earlier than v5.7014, delete the C<myapp.yml>
-file and simply follow the directions below to create a new
-C<myapp.conf> file.
+C<Config::General> (an apache-like format). In case you are using a
+version of Catalyst earlier than v5.7014, delete the C<myapp.yml>, or
+convert it to .conf format using the TIP in
+L<Catalyst::Manual::MoreCatalystBasics>; then simply follow the
+directions below to create a new C<myapp.conf> file.
Here, we need to load several parameters that tell
L<Catalyst::Plugin::Authentication|Catalyst::Plugin::Authentication>
[% META title = 'Login' %]
<!-- Login form -->
- <form method="post" action="[% Catalyst.uri_for('/login') %]">
+ <form method="post" action="[% c.uri_for('/login') %]">
<table>
<tr>
<td>Username:</td>
# This code illustrates how certain parts of the TT
# template will only be shown to users who have logged in
%]
- [% IF Catalyst.user_exists %]
- Please Note: You are already logged in as '[% Catalyst.user.username %]'.
- You can <a href="[% Catalyst.uri_for('/logout') %]">logout</a> here.
+ [% IF c.user_exists %]
+ Please Note: You are already logged in as '[% c.user.username %]'.
+ You can <a href="[% c.uri_for('/logout') %]">logout</a> here.
[% ELSE %]
You need to log in to use this application.
[% END %]
bottom (below the closing </table> tag):
<p>
- <a href="[% Catalyst.uri_for('/login') %]">Login</a>
- <a href="[% Catalyst.uri_for('form_create') %]">Create</a>
+ <a href="[% c.uri_for('/login') %]">Login</a>
+ <a href="[% c.uri_for('form_create') %]">Create</a>
</p>
Reload your browser and you should now see a "Login" and "Create" links
<div id="header">[% PROCESS site/header %]</div>
<div id="content">
- <span class="message">[% status_msg || Catalyst.flash.status_msg %]</span>
+ <span class="message">[% status_msg || c.flash.status_msg %]</span>
<span class="error">[% error_msg %]</span>
[% content %]
</div>
Although the a use of flash above is certainly an improvement over the
C<status_msg> we employed in Part 4 of the tutorial, the C<status_msg
-|| Catalyst.flash.status_msg> statement is a little ugly. A nice
+|| c.flash.status_msg> statement is a little ugly. A nice
alternative is to use the C<flash_to_stash> feature that automatically
copies the content of flash to stash. This makes your code controller
and template code work regardless of where it was directly access, a
L<http://localhost:3000/books/list> in your browser. Delete another
of the "Test" books you added in the previous step. Flash should still
maintain the status message across the redirect even though you are no
-longer explicitly accessing C<Catalyst.flash>.
+longer explicitly accessing C<c.flash>.
=head1 AUTHOR