[Catalyst] Change the default view
Zbigniew Lukasiak
zzbbyy at gmail.com
Mon Nov 3 14:11:18 GMT 2008
On Mon, Nov 3, 2008 at 2:59 PM, Dermot <paikkos at googlemail.com> wrote:
> Hi,
>
> I have a small subroutine/method that checks if a file exists. The
> method is being called by an Ajax function. Unlike the other functions
> in it's Class, this method doesn't need to render a tt template, it
> should simply return 1 or 0. .Catalyst is complaining that is can't
> render the template for this method but I don't want to render a
> template. I'm sure this is something to do with RenderView/end but I
> can't get it to stop doing -> Motion::View::TT->process.
>
>
> Any tips please?
> TIA,
> Dp.
>
>
> sub fileExists : Local {
> my ($self,$c) = @_;
> my $type = $c->request->param('type');
> my $number = $c->request->param('number');
> my $path = getPathFromNumber($number,$type);
> if (-e $path) {
> return 1;
replace this with $c->response->body( 1 ). If the response body is
set then RenderView does not call the view to generate it.
> }
> else {
> return 0;
> }
> $c->end;
> }
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/
More information about the Catalyst
mailing list