Navigation Menu

Skip to content

Commit

Permalink
added recipe for rendering static files manually
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 2, 2012
1 parent 334a139 commit 2a9d917
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.65 2012-12-03
- Improved documentation.

3.64 2012-12-01
- Improved documentation.
- Improved tests.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.64';
our $VERSION = '3.65';

sub AUTOLOAD {
my $self = shift;
Expand Down
8 changes: 8 additions & 0 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -771,6 +771,14 @@ plugin.

Less commonly used and more powerful features.

=head2 Rendering static files

You can manually render static files from your C<public> directories with
L<Mojolicious::Controller/"render_static">.

$self->res->headers->content_disposition('attachment; filename=bar.png;');
$self->render_static('foo/bar.png');

=head2 Chunked transfer encoding

For very dynamic content you might not know the response C<Content-Length> in
Expand Down

0 comments on commit 2a9d917

Please sign in to comment.