Created
July 18, 2010 08:47
-
-
Save memowe/480241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojolicious/Plugin/DefaultHelpers.pm b/lib/Mojolicious/Plugin/DefaultHelpers.pm | |
index 77717a8..e807bf5 100644 | |
--- a/lib/Mojolicious/Plugin/DefaultHelpers.pm | |
+++ b/lib/Mojolicious/Plugin/DefaultHelpers.pm | |
@@ -7,6 +7,7 @@ use warnings; | |
use base 'Mojolicious::Plugin'; | |
+use Mojo::ByteStream; | |
require Data::Dumper; | |
# You're watching Futurama, | |
@@ -48,6 +49,9 @@ sub register { | |
# Add "stash" helper | |
$app->renderer->add_helper(stash => sub { shift->stash(@_) }); | |
+ # Add stream helper | |
+ $app->renderer->add_helper(stream => sub { Mojo::ByteStream->new($_[1]) }); | |
+ | |
# Add "url_for" helper | |
$app->renderer->add_helper(url_for => sub { shift->url_for(@_) }); | |
} | |
@@ -112,6 +116,10 @@ Access session values. | |
Access stash values. | |
+=item stream | |
+ | |
+Create a L<Mojo::ByteStream> object from a string | |
+ | |
=item url_for | |
Generate URLs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment