Zbigniew Lukasiak wrote:
What is the advantage of this over:
sub view : Local {
my ( $self, $c, $id ) = @_;
$self-start( $c, $id );
# do something with $c-stash-{obj}
return 1;
}
For me there are lots of little reasons. I suppose its a personal choice.
I like the URI structure
On Fri, Oct 16, 2009 at 7:31 AM, J. Shirley jshir...@gmail.com wrote:
What database do you use? In MySQL and SQLite I get no exception at all:
Postgresql.
$ perl -Ilib -e 'use MyApp; my $obj =
MyApp-model('Schema::User')-find(bogus); print defined? . ( defined
$obj ? yes : no ) . \n';
I have a number of methods that start something like this:
sub view : Local Args(1) {
my ( $self, $c, $id ) = @_;
my $obj = $c-model( 'DB::Foo' )-find( $id )
|| return $c-res-status( 404 );
If $id is not valid then I might, as in that example, return with a 404
status.
Of
On Fri, Oct 16, 2009 at 7:19 AM, Matt Whipple m...@mattwhipple.com wrote:
I would probably avoid potentially hitting the database unnecessarily,
and only use the exception in the case of complicated validation. In the
case of simple validation, why not something simple along the lines of:
Bill Moseley wrote:
I have a number of methods that start something like this:
sub view : Local Args(1) {
my ( $self, $c, $id ) = @_;
my $obj = $c-model( 'DB::Foo' )-find( $id )
|| return $c-res-status( 404 );
If $id is not valid then I might, as in that example, return with a