Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Why is mojolicious "routing to a callback" ?

by pcouderc (Monk)
on Nov 25, 2015 at 11:20 UTC ( [id://1148592]=note: print w/replies, xml ) Need Help??


in reply to Re: Why is mojolicious "routing to a callback" ?
in thread Why is mojolicious "routing to a callback" ?

Mmm, minimum, it is trivial with : Login.pm
package Myapp::Controller::Login; use Mojo::Base 'Mojolicious::Controller'; sub nolog { my $c = shift; $c->session(userid => 1); $c->redirect_to('menu'); } 1;
and nolog.htlm.rp :
%= form_for nolog => (method => 'POST') => begin <p> % if (param 'user') { <b>Erreur dans le mot de passe ou le nom d'utilisateur. Veuillez r +éessayer</b><br> % } Utilisateur :<br> %= text_field 'user' <br>Mot de passe :<br> %= password_field 'pass' <br> %= submit_button 'Login' </p> % end
and login.htlm.ep :
<p> ... </p>
Self contained, I do not know how to do (I am not with Mojolicious::Lite)..

Replies are listed 'Best First'.
Re^3: Why is mojolicious "routing to a callback" ?
by Anonymous Monk on Nov 25, 2015 at 11:34 UTC
    Does Class "MyApp::Controller::Login" is not a controller mean anything to you?

      Very good spot by Anonymous Monk!

      Most likely you are on Windows, or on a case-insensitive file system. That way, Perl loads a file Myapp/Controller/Login.pm even if you ask for MyApp/Controller/Login.pm (note the capital "A" in MyApp). Perl itself remains case-sensitive and looks for a class MyApp::Controller::Login, but your module only declares Myapp::Controller::Login with a lowercase "a".

      In the part of your setup that you haven't shown, you are mixing up Myapp and MyApp. Correct that and maybe things work differently.

      Mm, no sorry, I do not know why you refer to MyApp. My application is Myapp. I am on linux which is case sensitive.
      Sorry, my problem is not so simple...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found