On 09/01/2014 03:56 AM, jean-marie.bourbon@armaturetech.com wrote:
Hi guys!
I recently tried to build my own web application using Dancer but I'm a basic perl developer and I have any interrogations about this framework.
I've first tried to build a login page based on your "navbar_login" example. Once logged in I try to call another page named "test" but it seems to not work (I don't know how to call my page and how Dancer work exactly .. to be honest :-( . ) : I have a login.pm module, main.tt (in views/layout/) index.tt and test.tt in views. Im my login.pm I have declared my routes as following:
get '/index' => sub { template 'index' };
get '/' => sub { template 'login' };
get 'test' => sub { template 'test'; };
So, once logged in I try (and fail) to call my page like this:
elsif($password eq "12345") { #print "ok"; #return '<script> document.location("./views/test.tt");</script>'; #return template 'examples/photo_carousel';# 'index'; #my @animals = qw/dogs cats camels mooses vogons/; return template 'test' => { show => "launching test.tt", }; #session $username => params->{$username}; #redirect params ->{'index'};
#show_ }
Fail also with redirect parameter .. But why and how to call my test page ? I don't understand why it doesn't work, can you explain me please ?
Thanks a lot !