init_request

The init_request callback is invoked just prior to a mode handler being processed, but after all the other information has been marshaled. It can be used to inspect and/or modify a request prior processing or rendering any HTML to the browser. One use case in which it has been commonly used is to modify the templates used to render the application, as is done in the iPhone plugin for Movable Type which will use a different set of templates based upon the user agent (the text string transmitted by the browser identifying the client software by name, e.g. "Firefox").

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $app - a reference to the MT::App::CMS object processing this request.

Return Value

None.

Example Handler

sub init_request_handler {
    my ($cb, $app) = @_;
    # do something
}

This page is part of the Events and Callbacks in Movable Type

This page was last updated on 2008-10-01, 17:03.

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.