[Catalyst-commits] r8216 - in
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib:
. MyApp/Controller
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Wed Aug 13 02:46:26 BST 2008
Author: karpet
Date: 2008-08-13 02:46:26 +0100 (Wed, 13 Aug 2008)
New Revision: 8216
Modified:
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp.pm
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Album.pm
CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Song.pm
Log:
clarify where/how to use Class::C3 in a CX::CRUD app
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Album.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Album.pm 2008-08-12 04:02:26 UTC (rev 8215)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Album.pm 2008-08-13 01:46:26 UTC (rev 8216)
@@ -5,8 +5,6 @@
use MyCRUD::Album::Form;
use Class::C3;
-Class::C3::initialize();
-
__PACKAGE__->config(
form_class => 'MyCRUD::Album::Form',
init_form => 'init_with_album',
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Song.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Song.pm 2008-08-12 04:02:26 UTC (rev 8215)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp/Controller/Song.pm 2008-08-13 01:46:26 UTC (rev 8216)
@@ -5,8 +5,6 @@
use MyCRUD::Song::Form;
use Class::C3;
-Class::C3::initialize(); # must do this in each controller??
-
__PACKAGE__->config(
form_class => 'MyCRUD::Song::Form',
init_form => 'init_with_song',
Modified: CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp.pm 2008-08-12 04:02:26 UTC (rev 8215)
+++ CatalystX-CRUD/CatalystX-CRUD-ModelAdapter-DBIC/trunk/t/example/MyApp/lib/MyApp.pm 2008-08-13 01:46:26 UTC (rev 8216)
@@ -31,6 +31,13 @@
# Start the application
__PACKAGE__->setup;
+# Class::C3 used by Controllers subclassing CatalystX::CRUD::Controller
+# so that multiple inheritance from ::REST controller works correctly.
+use Class::C3;
+
+# need to call this just once after setup() is done.
+Class::C3::initialize();
+
sub error404 {
my ($c) = @_;
$c->response->status(404);
More information about the Catalyst-commits
mailing list