From b0458a66db0a7d5d5ae87dd86d4fb8f259b4255d Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 13 Sep 2013 11:38:31 +0100 Subject: [PATCH] New templateurl variable. --- Webperl/Template.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Webperl/Template.pm b/Webperl/Template.pm index 86d6eb0..1354a40 100644 --- a/Webperl/Template.pm +++ b/Webperl/Template.pm @@ -111,6 +111,7 @@ # - `{V_[templatepath]}` is replaced by the path from the base of the web # application to the template directory (useful for image and other resource # paths inside the template). This will always have a trailing '/'. +# - `{V_[templateurl]}` like templatepath, but including the full URL. # - `{V_[commonpath]}` is replaced by the path from the base of the web # application to the common template directory (useful for image and other resource # paths inside the common template). This will always have a trailing '/'. @@ -355,6 +356,9 @@ sub set_template_dir { $self -> {"templatepath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"theme"}); $self -> {"templatepath"} .= "/" unless($self -> {"templatepath"} =~ m|/$|); # templatepath must have trailing slash + # The URL... + $self -> {"templateurl"} = path_join($self -> {"cgi"} -> url(-base => 1), $self -> {"templatepath"}); + # And the common path, if possible if($self -> {"fallback"}) { $self -> {"commonpath"} = path_join($self -> {"scriptpath"}, $self -> {"basedir"}, $self -> {"fallback"});