| 1 | |||
| 2 | package ASP4::FormHandler; | ||
| 3 | |||
| 4 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 8 | ▶ | use warnings 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 8 | ▶ | use base 'ASP4::HTTPHandler'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 8 | ▶ | use vars __PACKAGE__->VARS; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 8 | 1;# return true: | |
| 10 | |||
| 11 | =pod | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | ASP4::FormHandler - Base class for all form handlers | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | package my::handler; | ||
| 20 | |||
| 21 | use strict; | ||
| 22 | use warnings 'all'; | ||
| 23 | use base 'ASP4::FormHandler'; | ||
| 24 | |||
| 25 | # Import $Request, $Response, $Session, $Server, $Form, $Config, $Stash | ||
| 26 | use vars __PACKAGE__->VARS; | ||
| 27 | |||
| 28 | sub run { | ||
| 29 | my ($self, $context) = @_; | ||
| 30 | |||
| 31 | $Response->Write("Hello, World!"); | ||
| 32 | } | ||
| 33 | |||
| 34 | 1;# return true: | ||
| 35 | |||
| 36 | =head1 DESCRIPTION | ||
| 37 | |||
| 38 | All ASP4 *.asp scripts and C</handlers/*> classes should inherit from C<ASP4::FormHandler>. | ||
| 39 | |||
| 40 | =head1 PROPERTIES | ||
| 41 | |||
| 42 | =head2 VARS | ||
| 43 | |||
| 44 | Returns the list of variable names of the ASP4 intrinsic objects. | ||
| 45 | |||
| 46 | $Request $Response | ||
| 47 | $Session $Server | ||
| 48 | $Config $Form | ||
| 49 | $Stash | ||
| 50 | |||
| 51 | =head1 METHODS | ||
| 52 | |||
| 53 | =head2 before_run( $self, $context ) | ||
| 54 | |||
| 55 | Called before C<run> - can be used to deny access or redirect elsewhere under | ||
| 56 | special conditions. | ||
| 57 | |||
| 58 | =head2 run( $self, $context ) | ||
| 59 | |||
| 60 | Where most of your action is expected to occur. | ||
| 61 | |||
| 62 | =head2 after_run( $self, $context ) | ||
| 63 | |||
| 64 | Called after C<run>, can be used | ||
| 65 | |||
| 66 | =head1 BUGS | ||
| 67 | |||
| 68 | It's possible that some bugs have found their way into this release. | ||
| 69 | |||
| 70 | Use RT L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=ASP4> to submit bug reports. | ||
| 71 | |||
| 72 | =head1 HOMEPAGE | ||
| 73 | |||
| 74 | Please visit the ASP4 homepage at L<http://0x31337.org/code/> to see examples | ||
| 75 | of ASP4 in action. | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||