Apache::App::Mercury::Controller - Example Controller class


Apache-App-Mercury documentation  | view source Contained in the Apache-App-Mercury distribution.

Index


NAME

Top

Apache::App::Mercury::Controller - Example Controller class

DESCRIPTION

Top

This is simply a skeleton class which illustrates how a controller should interact with Apache::App::Mercury. Please look at the code to see how it should contruct and initialize an Apache::App::Mercury object, run its main content handler, and then cleanup non-persistent instance variables on completion. It does not illustrate object persistence; not for difficulty reasons, simply for lack of time. I highly recommend Apache::Session.

The below instance variables and accessors are required in your controller class for Apache::App::Mercury to operate properly.

INSTANCE VARIABLES

Top

* $controller->{q}

A CGI query object for the current http request.

* $controller->{r}

An Apache->request object for the current http request.

ACCESSORS

Top

* infomsg([$msg])

Set or get a page-specific informational message. The controller should display this message in some prominent location on the resulting HTML page.

* pagetitle([$title])

Set or get the HTML page title.

* pagebody([$body])

Set or get the page body content.

* get_time()

Return the current unixtime, as returned by the Perl time() function. This accessor is used for time synchronization throughout the application, so your controller can keep a single time for each http request.

* sitemark([$mark])

Set or get a page-specific location mark, for logging purposes.

AUTHOR

Top

Adi Fairbank <adi@adiraj.org>

COPYRIGHT

Top

LAST MODIFIED

Top

July 19, 2003


Apache-App-Mercury documentation  | view source Contained in the Apache-App-Mercury distribution.