Skip to content

Instantly share code, notes, and snippets.

@webcrafts
Created December 4, 2012 05:21
Show Gist options
  • Save webcrafts/4200897 to your computer and use it in GitHub Desktop.
Save webcrafts/4200897 to your computer and use it in GitHub Desktop.
2012/12/04 フォームの内容を受け取って表示するだけ
#!/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