HTML::Shakan::Model::DataModel - Data::Model bindings for Shakan
# in edit form my $form = HTML::Shakan->new( model => 'DataModel' ); my $row = $dm->lookup('any_table', 1); if ($form->submitted_and_valid) { $form->model->update( $row ); redirect('/to/anywhere'); } else { $form->model->fill( $row ); render_template({form => $form, row => $row}); } # add form my $form = HTML::Shakan->new( model => 'DataModel' ); if ($form->submitted_and_valid) { $form->model->create( $model, 'user' ); redirect('/to/anywhere'); } else { $form->model->fill( $row ); render_template({form => $form, row => $row}); }
wrapper class for Data::Model & HTML::Shakan
fill this row to form
insert new row.
update this row
Data::Model
To install HTML::Shakan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Shakan
CPAN shell
perl -MCPAN -e shell install HTML::Shakan
For more information on module installation, please visit the detailed CPAN module installation guide.