Catalyst::Manual::Tutorial::AdvancedCRUD 0.02
Sponsored Links
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 Ranking & Summary
File size:
0.12 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1102
Date added:
2006-10-17
Publisher:
Kennedy Clark
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 description
Catalyst::Manual::Tutorial::AdvancedCRUD is a Catalyst Tutorial - Part 8: Advanced CRUD.
Add a Form Creation Helper Method
Open lib/MyApp/Controller/Books.pm in your editor and add the following method:
=head2 make_book_widget
Build an HTML::Widget form for book creation and updates
=cut
sub make_book_widget {
my ($self, $c) = @_;
# Create an HTML::Widget to build the form
my $w = $c->widget(book_form)->method(post);
# Get authors
my @authorObjs = $c->model("MyAppDB::Author")->all();
my @authors = map {$_->id => $_->last_name }
sort {$a->last_name cmp $b->last_name} @authorObjs;
# Create the form feilds
$w->element(Textfield, title )->label(Title)->size(60);
$w->element(Textfield, rating )->label(Rating)->size(1);
$w->element(Select, authors)->label(Authors)
->options(@authors);
$w->element(Submit, submit )->value(submit);
# Return the widget
return $w;
}
This method provides a central location that builds an HTML::Widget-based form with the appropriate fields. The "Get authors" code uses DBIC to retrieve a list of model objects and then uses map to create a hash where the hash keys are the database primary keys from the authors table and the associated values are the last names of the authors.
Add a Form Creation Helper Method
Open lib/MyApp/Controller/Books.pm in your editor and add the following method:
=head2 make_book_widget
Build an HTML::Widget form for book creation and updates
=cut
sub make_book_widget {
my ($self, $c) = @_;
# Create an HTML::Widget to build the form
my $w = $c->widget(book_form)->method(post);
# Get authors
my @authorObjs = $c->model("MyAppDB::Author")->all();
my @authors = map {$_->id => $_->last_name }
sort {$a->last_name cmp $b->last_name} @authorObjs;
# Create the form feilds
$w->element(Textfield, title )->label(Title)->size(60);
$w->element(Textfield, rating )->label(Rating)->size(1);
$w->element(Select, authors)->label(Authors)
->options(@authors);
$w->element(Submit, submit )->value(submit);
# Return the widget
return $w;
}
This method provides a central location that builds an HTML::Widget-based form with the appropriate fields. The "Get authors" code uses DBIC to retrieve a list of model objects and then uses map to create a hash where the hash keys are the database primary keys from the authors table and the associated values are the last names of the authors.
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 Screenshot
Advertisements
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 Keywords
AdvancedCRUD
CRUD
Advanced CRUD
Part 8
Catalyst Tutorial
AdvancedCRUD 0.02
authors
form
last
part
tutorial
widget
Catalyst::Manual::Tutorial::AdvancedCRUD
CatalystManualTutorialAdvancedCRUD
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02
Libraries
Bookmark Catalyst::Manual::Tutorial::AdvancedCRUD 0.02
Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 Copyright
WareSeeker periodically updates pricing and software information of Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
authors on the web
famous authors
authors from around
authors purpose
authors card game
american authors
african american authors
authors at google
21 cfr part 820
perl catalyst tutorial
authors biography
black authors
authors guild
authors of childrens books
catalyst tutorial perl
filipino authors
women authors
authors online
Related Software
Catalyst::Manual::Tutorial::BasicCRUD is a Catalyst Tutorial - Part 3: Basic CRUD. Free Download
Jifty::Manual::Tutorial is a Perl module for Zero to Jifty in a Jiffy. Free Download
Task::Catalyst::Tutorial is a Perl module that installs everything you need to learn Catalyst. Free Download
Catalyst::Manual::Intro is an Introduction to Catalyst. Free Download
Catalyst::Plugin::Dumper is a Perl module with Data::Dumper plugin for Catalyst. Free Download
Catalyst::Manual::Cookbook is a Perl module for cooking with Catalyst. Free Download
Catalyst::Example::InstantCRUD is a CRUD scaffolding for Catalyst. Free Download
Array::Each::Tutorial - POD giving various examples how to use Array::Each. Free Download
Latest Software
Popular Software
Favourite Software