hab es jetzt doch nochmal mit CGI::Application (bzw. mit CGI::Application::Plus)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package Ox::WebMail;
use strict;
use warnings;
use base 'CGI::Application::Plus';
use Ox::WebMail::Consts;
sub cgiapp_get_query {
require CGI::Simple;
my $cgi = CGI::Simple->new();
$cgi->parse_query_string();
return $cgi;
}
sub setup {
my $self = shift;
$self->tmpl_path(&Ox::WebMail::Consts::TEMPLATE_PATH);
$self->header_props(
-type => 'text/html',
-charset => &Ox::WebMail::Consts::CONTENT_CHARSET,
);
$self->mode_param('action');
$self->start_mode('login');
$self->run_modes({
'login' => sub {
require Ox::WebMail::Login;
return Ox::WebMail::Login->new()->run()
}
});
}
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package Ox::WebMail::Login;
use strict;
use warnings;
use base 'CGI::Application::Plus';
sub setup {
my $self = shift;
$self->tmpl_path(&Ox::WebMail::Consts::TEMPLATE_PATH_LOGIN);
$self->header_type('none');
$self->mode_param('login');
$self->start_mode('form');
$self->run_modes({
'form' => 'show_form',
});
}
sub show_form {
my $self = shift;
my $tmpl = $self->load_tmpl(
'form.tpl',
die_on_bad_params => 0,
cache => 1
);
return $tmpl->output;
}
1;
wenn ich das jetzt laufen lasse, wird die Template-Form (show_form) vor dem HTTP-Header ausgegeben!
Wenn ich anstatt 'CGI::Application::Plus' 'CGI::Application' verwende, wird zuerst dir form, dann den header und dann die form wieder ausgegen... wo ist mein Fehler?\n\n
<!--EDIT|esskar|1108333989-->