本文整理匯總了PHP中WebRequest::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebRequest::output方法的具體用法?PHP WebRequest::output怎麽用?PHP WebRequest::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebRequest
的用法示例。
在下文中一共展示了WebRequest::output方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
public function execute()
{
Hooks::run("PreSetupPage");
// set up the page
$this->setupPage();
try {
if (!Hooks::run("PreRunPage", array(false, $this))) {
// "run" the page - allow the user to make any customisations to the
// current state
$this->runPage();
Hooks::run("PostRunPage", array("", $this->mSmarty));
}
} catch (AccessDeniedException $ex) {
$this->handleAccessDeniedException($ex);
}
// perform any final setup for the page, overwriting any user
// customisations which aren't allowed, and anything that potentially
// needs to be rebuilt/updated.
$this->finalSetup();
Hooks::run("PostFinalSetup");
try {
// get the page content
$content = $this->mSmarty->fetch($this->mBasePage);
} catch (SmartyException $ex) {
if (strpos($ex->getMessage(), "Unable to load template file") !== false) {
// throw our own exception so the stack trace comes back here.
throw new SmartyTemplateNotFoundException($ex->getMessage(), $ex->getCode());
}
}
// set any HTTP headers
foreach ($this->mHeaders as $h) {
header($h);
}
// send the cookies to make the client smile and go mmmmm nom nom
WebRequest::sendCookies();
// send the output
WebRequest::output($content);
}