Created
April 22, 2013 05:33
-
-
Save taiyoh/5432615 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
package MyApp::Web::ViewFunctions; | |
use Tiffany::Text::MicroTemplate::Extended; | |
package Tiffany::Text::MicroTemplate::Extended; | |
use strict; | |
use warnings; | |
sub c { Amon2->context } | |
sub uri_with { Amon2->context->req->uri_with(@_) } | |
sub uri_for { Amon2->context->uri_for(@_) } | |
sub mark_raw { Text::MicroTemplate::EncodedString->new($_[0]) } | |
sub nl2br { | |
my $str = shift || ''; | |
$str =~ s{\r?\n}{<br />}g; | |
mark_raw($str); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment