Created
December 4, 2012 05:21
-
-
Save webcrafts/4200897 to your computer and use it in GitHub Desktop.
2012/12/04 フォームの内容を受け取って表示するだけ
This file contains 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; | |
use utf8; | |
# form演習 2012/12/04 | |
get '/form' => sub { | |
my $self = shift; | |
my $title = $self->param('title'); | |
my $comment = $self->param('comment'); | |
$self->stash('title' => $title); | |
$self->stash('comment' => $comment); | |
$self->render(); | |
} => 'index'; | |
app->start; | |
__DATA__ | |
@@ index.html.ep | |
<html> | |
<head> | |
<title>Form Example</title> | |
</head> | |
<body> | |
<p>タイトルで指定された文字列は「<%= $title %>」</p> | |
<p>コメントは「<%= $comment %>」</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment