本文整理汇总了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);
}