[% 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