[dancer-users] Question about Perl Dancer Framework
jean-marie.bourbon at armaturetech.com
jean-marie.bourbon at armaturetech.com
Mon Sep 1 17:45:00 BST 2014
On 09/01/2014 03:56 AM, jean-marie.bourbon at 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 !
>
More information about the dancer-users
mailing list