Skip to content

Commit

Permalink
added example for custom modification time
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 13, 2014
1 parent 5182c27 commit dd3aadb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Controller.pm
Expand Up @@ -624,7 +624,7 @@ Prepare a C<302> redirect response, takes the same arguments as L</"url_for">.
my $bool = $c->render(handler => 'something');
my $bool = $c->render('foo/index');
Render content using L<Mojolicious::Renderer/"render"> and emit hooks
Render content with L<Mojolicious::Renderer/"render"> and emit hooks
L<Mojolicious/"before_render"> as well as L<Mojolicious/"after_render">. If no
template is provided a default one based on controller and action or route
name will be generated with L<Mojolicious::Renderer/"template_for">, all
Expand Down
12 changes: 9 additions & 3 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -374,9 +374,15 @@ Alias for L<Mojolicious::Controller/"param">.
$c->reply->asset(Mojo::Asset::File->new);
Reply with L<Mojo::Asset::File> or L<Mojo::Asset::Memory> object using
L<Mojolicious::Static/"serve_asset">, and perform content negotiation with
C<Range>, C<If-Modified-Since> and C<If-None-Match> headers.
Reply with L<Mojo::Asset::File> or L<Mojo::Asset::Memory> object and perform
content negotiation using C<Range>, C<If-Modified-Since> and C<If-None-Match>
headers with L<Mojolicious::Static/"serve_asset">.
# Serve asset with custom modification time
my $asset = Mojo::Asset::Memory->new;
$asset->add_chunk('Hello World!')->mtime(784111777);
$c->res->headers->content_type('text/plain');
$c->reply->asset($asset);
=head2 reply->exception
Expand Down

0 comments on commit dd3aadb

Please sign in to comment.