From cd2e069816416dd42ed2528e4843c07309a31f27 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 1 Sep 2012 03:07:36 +0200 Subject: Caching the templates. --- lib/FPanel/Login.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/FPanel/Login.pm') diff --git a/lib/FPanel/Login.pm b/lib/FPanel/Login.pm index 332a380..dc5ae3a 100644 --- a/lib/FPanel/Login.pm +++ b/lib/FPanel/Login.pm @@ -67,7 +67,7 @@ sub setup { } -# This method choses the Run Mode depending on the URL and query string. +# This method chooses the Run Mode depending on the URL and query string. sub mymode_param { my $self = shift; my $q = $self->query; @@ -135,7 +135,9 @@ sub login : Runmode { sub login_box { my $self = shift; - my $template = $self->load_tmpl('login.html'); + my $template = $self->load_tmpl('login.html' + , cache => 1 + , utf8 => 1 ); my $destination = $self->query->param('destination') // $self->mymode_param(); @@ -159,10 +161,14 @@ sub logout : Runmode { sub error_rm : ErrorRunmode { my $self = shift; my $error = shift; - my $template = $self->load_tmpl("template/error.html"); + + my $template = $self->load_tmpl('error.html' + , cache => 1 + , utf8 => 1 ); $template->param(NAME => 'ERROR'); $template->param(MESSAGE => $error); $template->param(URL => $self->query->url); + return $template->output; } -- cgit v1.2.3