The Page preRender function

Before WebTemplate evaluates and renders the templates for a Page, it will call the Page::preRender function.  The Page class can be extended and the preRender function can be overridden so any processing can occur before a page is outputted.

Example: logout if the URI contains the query cmd=logout

class Page extends WTPage {
  public function preRender() {
    $cmd = $GLOBALS["WT"]->getRequestValue("cmd");
    if($cmd == "logout") {
      $GLOBALS["WT"]->logout();
    }
  }
}

$GLOBALS["WT"]->registerNodeTypeClass("Page", "Page");