GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Amon2::Web(3) User Contributed Perl Documentation Amon2::Web(3)

Amon2::Web - Web Application Base.

    package MyApp;
    use parent qw/Amon2/;

    package MyApp::Web;
    use parent qw/MyApp Amon2::Web/;

This is a web application base class.

"$c->create_request()"
Create new request object from $c.

You can override this method to change request object's class.

"$c->create_response($code, \@headers, \@body)"
Create new response object.

You can override this method to change response object's class.

"$c->create_view()"
Create new view object. View object should have "$view->render(@_)" method.

You can override this method to change view object's class.

"$c->dispatch() : Plack::Response"
Do dispatch request. This method must return instance of Plack::Response.

You can override this method to change behavior.

"$c->html_content_type() : Str"
Returns default Content-Type value for the HTML response.

You can override this method to change behavior.

"$c->request() : Plack::Request"
"$c->req() : Plack::Request"
This is a accessor method to get the request object in this context.
"$c->redirect($location : Str, \%parameters) : Plack::Response"
Create a response object to redirect for $location with "\%parameters".

    $c->redirect('/foo', +{bar => 3})
    

is same as following(if base URL is http://localhost:5000/)

    $c->create_response(302, [Location => 'http://localhost:5000/foo?bar=3'])
    
"$c->res_403()"
Create new response object which has 403 status code.
"$c->res_404()"
Create new response object which has 404 status code.
"$c->res_405()"
Create new response object which has 405 status code.
"$c->create_simple_status_page($code, $message)"
Create a new response object which represents specified status code.
"MyApp->to_app() : CodeRef"
Create an instance of PSGI application.
"$c->uri_for($path: Str, \%args) : Str"
Create URI from $path and "\%args".

This method returns relative URI.

"$c->render($tmpl[, @args|%args]) : Plack::Web::Response"
This method renders HTML.
"$c->encoding()"
Return a encoding object using "Encode::find_encoding()".

You can override this method to change behavior.

"$c->encode_html($html) : Str"
This method encodes HTML from bytes.

You can override this method to change behavior.

2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.