[Catalyst] newbie - syntax error
Dermot
paikkos at googlemail.com
Fri Feb 22 14:47:38 GMT 2008
Hi,
I hope my first question isn't too dumb.
In the routine below I want to test if the method is being called with an
additional parameters. So if the uri is ~/list/2
return only the files with user=3Did. If no parameter is called (~/list)
return all files. The functions works as it is but obviously I can not
recall all files.
Without the comments the list function returns a syntax error. In fact I can
also get the same error is I do:
my $files;
$files : Stashed =3D $c->model('ImagesDB::Files')->search({user =3D> $id});
use base 'Catalyst::Controller::BindLex'
...
sub list : Local {
my ($self, $c, $id) =3D @_;
#my $files;
#if (defined($id)) {
my $files : Stashed =3D $c->model('ImagesDB::Files')->search({user =
=3D>
$id});
#}
#else {
# my $files : Stashed =3D $c->model('ImagesDB::Files');
#}
$c->stash->{template} =3D 'files/list.tt2';
}
Can anyone give me a pointer? Thanx.
Dp.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080222/f5d9a=
a39/attachment.htm
More information about the Catalyst
mailing list