-
-
Save TristinDavis/4097371 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Mojolicious::Lite; | |
get '/' => { message => '' } => 'index'; | |
post '/' => sub { | |
my $self = shift; | |
# getting params | |
my $email = $self->param('email') || ''; | |
my $password = $self->param('password') || ''; | |
$self->stash( message => "Dumper email => $email and pass => $password" ); | |
} => 'index'; | |
get '/test' => { message => 'None here!' } => 'activityform'; | |
post '/test' => sub { | |
my $self = shift; | |
$self->stash( | |
message => $self->param('data') | |
); | |
} => 'activityform'; | |
app->start; | |
__DATA__ | |
@@ index.html.ep | |
% layout 'default'; | |
<form method="post"> | |
<h2>Times Login</h2> | |
<p><label>E-mail:<input type="text" name="email" placeholder="[email protected]" /></label></p> | |
<p><label>Senha:<input type="password" name="password" placeholder="******" /></label></p> | |
<input type="submit" value="Entrar" class="btn btn-danger" /> | |
<small style="text-red"><%= $message %></small> | |
</form> | |
@@ activityform.html.ep | |
% layout 'default'; | |
<form method="post"> | |
<label class="control-label" for="date">Data:</label> | |
<input type="text" name"data" /> | |
<input type="submit" value"Send" /> | |
</form> | |
<%= $message %> | |
@@ layouts/default.html.ep | |
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Times :: Timesheet App</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content="Bivee"> | |
</head> | |
<body> | |
<%= content %> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment