[Fortaleza] Código falho
André Lima
andreluismlima at hotmail.com
Sun Jan 17 09:13:49 PST 2010
O que há de errado com o seguinte código?
sub edit : Local Form {
my ($self, $c, $id) = @_;
my $person = $c->model('AddressDB::People')->
find_or_new({id => $id});
if ($c->form->submitted && $c->form->validate) {
$person->firstname($c->form->field('firstname'));
$person->lastname ($c->form->field( 'lastname'));
$person->update_or_insert;
$c->stash->{message} =
($id > 0 ? 'Updated ' : 'Added ') . $person->name;
$c->forward('list');
}
else {
if(!$id){
$c->stash->{message} = 'Adding a new person';
}
$c->form->field(name => 'firstname',
value => $person->firstname);
$c->form->field(name => 'lastname',
value => $person->lastname);
}
}
_________________________________________________________________
Agora é fácil compartilhar fotos no Messenger: solte todas na janelinha. Veja como!
http://www.windowslive.com.br/public/tip.aspx/view/77?product=2&ocid=CRM-WindowsLive:dicaCompartilhamentoFotos:Tagline:WLCRM:On:WL:pt-BR:Messenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/fortaleza/attachments/20100117/5fdd5c3d/attachment.html>
More information about the Fortaleza
mailing list