On 4 Jan 2009, at 08:48, Trevor Phillips wrote:
I'm currently trying to use Catalyst::Plugin::Static::Simple, which has a documented function serve_static_file to serve a static file from a Controller. However, I am getting an error as the TT View is still trying to apply a default template.

Just use a stash key to indicate that you have served a file yourself to stop calling TT.. e.g.

sub serve_stuff : Local {
    my ( $self, $c ) = @_;
    $c->serve_static_file('some_file');
    $c->stash->{file_output} = 1;
}

sub end : Private {
    my ( $self, $c ) = @_;
    $c->detach('render') unless $c->stash->{file_output};
}

sub render : ActionClass('RenderView') {}

Cheers
t0m


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to