root/lang/perl/MENTA/trunk/app/menta.cgi @ 23594

Revision 23594, 1.1 kB (checked in by tokuhirom, 5 years ago)

プラグインつかったりする場合は別モジュールにできると便利なのかもしれないね

Line 
1#!/usr/bin/perl
2use lib '../lib';
3use MENTA;
4# -- ここまではおまじない --
5
6require "../plugins/mail.pl";
7
8run_menta({
9    # MENTA 自体の設定
10    menta => {
11        # エラー出力するか?
12        kcatch_mode => 1,
13        # 最大表示文字数
14        max_post_body => 1_024_000,
15        # コントローラーをいれるディレクトリ
16        controller_dir => 'controller/',
17        # テンプレートファイルディレクトリへのパス
18        tmpl_dir => 'tmpl/',
19        # テンプレートファイルのキャッシュディレクトリへのパス
20        tmpl_cache_dir => 'tmpl_cache/',
21    },
22    # あなたのアプリの設定
23    application => {
24        docroot => '',
25        title => 'MENTA サンプルアプリ',
26    },
27});
28
29# あなたのプログラム
30sub do_index {
31    render('index.html');
32}
33
34sub do_goto_wassr {
35    redirect('http://wassr.jp/');
36}
37
38sub do_mail {
39    mail_send('info@example.com', 'this is subject', 'hi!');
40    redirect('http://example.com');
41}
42
43sub do_form {
44    my $r = param('r') || '';
45    render('form.html', $r);
46}
47
48sub do_die {
49    die "こういう風に死にます"
50}
51
Note: See TracBrowser for help on using the browser.