Thread runmode in CGI::Application "nachträglich" ändern (3 answers)
Opened by Superfrank at 2007-08-23 16:43

renee
 2007-08-23 16:48
#98571 #98571
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Du kannst die Funktion ganz normal aufrufen

Code (perl): (dl )
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
package MyApp;

use strict;
use warnings;
use base qw(CGI::Application::Plugin::HTCompiled CGI::Application);


sub setup{
    my ($self) = @_;

    $self->start_mode( 'box' );
    $self->mode_param( 'rm' );
    $self->run_modes(
        AUTOLOAD    => \&error,
        outbox      => \&outbox,
        inbox       => \&inbox,
    );
}

sub inbox{
    my ($self) = @_;
    
    return $self->outbox;
}

sub outbox{
    my ($self) = @_;
    
    retun "outbox";
}


Oder per redirect:

Code (perl): (dl )
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
package MyApp;

use strict;
use warnings;
use base qw(CGI::Application::Plugin::HTCompiled CGI::Application);
use CGI::Application::Plugin::Redirect;


sub setup{
    my ($self) = @_;

    $self->start_mode( 'box' );
    $self->mode_param( 'rm' );
    $self->run_modes(
        AUTOLOAD    => \&error,
        outbox      => \&outbox,
        inbox       => \&inbox,
    );
}

sub inbox{
    my ($self) = @_;
    my $url = 'http://localhost/skript.cgi?rm=outbox';
    
    $self->redirect( $url );
}

sub outbox{
    my ($self) = @_;
    
    retun "outbox";
}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread runmode in CGI::Application "nachträglich" ändern