Commit | Line | Data |
---|---|---|
b8a92065 | 1 | package stemmaweb::View::SVG; |
2 | ||
3 | use strict; | |
4 | use base 'Catalyst::View'; | |
b8a92065 | 5 | |
6 | sub process { | |
6cf17f04 | 7 | my( $self, $c ) = @_; |
8 | $c->res->content_type( 'image/svg+xml' ); | |
9 | $c->res->content_encoding( 'UTF-8' ); | |
10 | if( $c->stash->{download} ) { | |
11 | $c->res->header( 'Content-Disposition', | |
12 | sprintf( "attachment; filename=\"%s.svg\"", $c->stash->{name} ) ); | |
13 | } | |
14 | $c->res->output( $c->stash->{result} ); | |
b8a92065 | 15 | } |
16 | ||
17 | 1; |