Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
698fc48b58 | ||
|
|
49075ebe44 | ||
|
|
0acdb2fcde | ||
|
|
dc52fec399 | ||
|
|
a896a311bb |
@@ -1,6 +1,13 @@
|
|||||||
Revision history for MojoX-Renderer-TT
|
Revision history for MojoX-Renderer-TT
|
||||||
|
|
||||||
{{$NEXT}}
|
{{$NEXT}}
|
||||||
|
- Compatibility with Mojolicious 1.3+
|
||||||
|
|
||||||
|
1.12 February 28, 2011
|
||||||
|
- Inline wrappers and includes now work on Windows
|
||||||
|
(GH#13, Christiaan Kras)
|
||||||
|
|
||||||
|
1.11 February 6, 2011
|
||||||
- Change to use relative paths (Marcus Ramberg)
|
- Change to use relative paths (Marcus Ramberg)
|
||||||
- Add exception template for tests
|
- Add exception template for tests
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ copyright_holder = Ask Bjørn Hansen
|
|||||||
# copyright_year = 2009
|
# copyright_year = 2009
|
||||||
|
|
||||||
[Prereqs]
|
[Prereqs]
|
||||||
Mojolicious = 1.01
|
Mojolicious = 1.3
|
||||||
Template = 2.18
|
Template = 2.18
|
||||||
|
|
||||||
[Prereqs / TestRequires ]
|
[Prereqs / TestRequires ]
|
||||||
|
|||||||
@@ -150,14 +150,16 @@ sub _template_content {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($path) = @_;
|
my ($path) = @_;
|
||||||
|
|
||||||
my ($t) = ($path =~ m{templates[\/|\\](.*)$});
|
# Convert backslashes to forward slashes to make inline templates work on Windows
|
||||||
|
$path =~ s/\\/\//g;
|
||||||
|
my ($t) = ($path =~ m{templates\/(.*)$});
|
||||||
|
|
||||||
if (-r $path) {
|
if (-r $path) {
|
||||||
return $self->SUPER::_template_content(@_);
|
return $self->SUPER::_template_content(@_);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Try DATA section
|
# Try DATA section
|
||||||
elsif (my $d = $self->renderer->get_inline_template($self->ctx, $t)) {
|
elsif (my $d = $self->renderer->get_data_template($self->ctx, $t)) {
|
||||||
return wantarray ? ($d, '', time) : $d;
|
return wantarray ? ($d, '', time) : $d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -94,13 +94,13 @@ __DATA__
|
|||||||
@@ include.inc
|
@@ include.inc
|
||||||
Hello
|
Hello
|
||||||
|
|
||||||
@@ includes/include.inc
|
@@ includes/sub/include.inc
|
||||||
Hallo
|
Hallo
|
||||||
|
|
||||||
@@ include.html.tt
|
@@ include.html.tt
|
||||||
[%- INCLUDE 'include.inc' -%]
|
[%- INCLUDE 'include.inc' -%]
|
||||||
Include!
|
Include!
|
||||||
[% INCLUDE 'includes/include.inc' -%]
|
[% INCLUDE 'includes/sub/include.inc' -%]
|
||||||
|
|
||||||
@@ layouts/layout.html.tt
|
@@ layouts/layout.html.tt
|
||||||
w[%- content -%]d
|
w[%- content -%]d
|
||||||
|
|||||||
Reference in New Issue
Block a user