[Jifty-commit] r4084 - in jifty/trunk: lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Sep 11 17:38:59 EDT 2007
Author: sterling
Date: Tue Sep 11 17:38:58 2007
New Revision: 4084
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
Log:
r11956 at dynpc145: andrew | 2007-09-11 16:38:08 -0500
Adding another CRUD setup example to the synopsis.
Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm Tue Sep 11 17:38:58 2007
@@ -18,13 +18,40 @@
=head1 SYNOPSIS
+ package App::View::User;
+ use Jifty::View::Declare -base;
+ use base qw/ Jifty::View::Declare::CRUD /;
+
+ template 'view' => sub {
+ # customize the view
+ };
+
+ 1;
+
+ package App::View::Tag;
+ use Jifty::View::Declare -base;
+ use base qw/ Jifty::View::Declare::CRUD /;
+
+ template 'view' => sub {
+ # customize the view
+ };
+
+ 1;
+
package App::View;
use Jifty::View::Declare -base;
use Jifty::View::Declare::CRUD;
+
+ # If you have customizations, this is a good way...
Jifty::View::Declare::CRUD->mount_view('User');
Jifty::View::Declare::CRUD->mount_view('Category', 'App::View::Tag', '/tag');
+ # Another way to do the above, good for quick and dirty
+ alias Jifty::View::Declare::CRUD under '/admin/blog', {
+ object_type => 'BlogPost',
+ };
+
=head1 DESCRIPTION
This class provides a set of views that may be used by a model to display
More information about the Jifty-commit
mailing list