X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FIntro.pod;h=632e1c3ecc66d6bda6b3518a5c91fb648b75d182;hp=5205bff5a7b9dc677313573b8fd27288aca75baa;hb=90bb105a110e94c71fca62dc8f41a6d3a46d8330;hpb=7d310f12e2caaf8e94e8f7f94e88d46698c77fde diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 5205bff..632e1c3 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -332,19 +332,22 @@ But first, we need a database. % sqlite /tmp/myapp.db < myapp.sql -Now we can create a DBIC::SchemaLoader component for this database. +Now we can create a DBIC::Schema model for this database. - script/myapp_create.pl model DBIC DBIC::SchemaLoader 'dbi:SQLite:/tmp/myapp.db' + script/myapp_create.pl model MyModel DBIC::Schema MySchema create=static 'dbi:SQLite:/tmp/myapp.db' L automatically loads table layouts and -relationships. Use the stash to pass data to your templates. +relationships, and converts them into a static schema definition C, +which you can edit later. + +Use the stash to pass data to your templates. We add the following to MyApp/Controller/Root.pm sub view : Global { my ( $self, $c, $id ) = @_; - $c->stash->{item} = $c->model('DBIC::Foo')->find($id); + $c->stash->{item} = $c->model('MyModel::Foo')->find($id); } 1;