本文整理汇总了PHP中HeaderUtil::sendHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP HeaderUtil::sendHeaders方法的具体用法?PHP HeaderUtil::sendHeaders怎么用?PHP HeaderUtil::sendHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeaderUtil
的用法示例。
在下文中一共展示了HeaderUtil::sendHeaders方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @see Action::execute()
*/
public function execute()
{
parent::execute();
// add edit note
$postData = array();
if (!$this->board->getPermission('canHideEditNote') && (WCF::getUser()->userID != $this->post->userID || $this->post->time <= TIME_NOW - POST_EDIT_HIDE_EDIT_NOTE_PERIOD * 60)) {
$postData['editor'] = WCF::getUser()->username;
$postData['editorID'] = WCF::getUser()->userID;
$postData['lastEditTime'] = TIME_NOW;
$postData['editCount'] = $this->post->editCount + 1;
$postData['editReason'] = '';
}
// update message
$this->post->updateMessage($this->text, $postData);
if ($this->thread->firstPostID == $this->post->postID) {
// update first post preview
$this->post->updateFirstPostPreview($this->post->threadID, $this->post->postID, $this->text, array('enableSmilies' => $this->post->enableSmilies, 'enableHtml' => $this->post->enableHtml, 'enableBBCodes' => $this->post->enableBBCodes));
}
$this->executed();
// get new formatted message and return it
$postList = new PostList();
$postList->sqlConditions = 'post.postID = ' . $this->postID;
$postList->readPosts();
$post = reset($postList->posts);
HeaderUtil::sendHeaders();
echo $post->getFormattedMessage();
}
示例2: show
/**
* @see Page::show()
*/
public function show()
{
parent::show();
HeaderUtil::sendHeaders();
echo $this->post->message;
}
示例3: display
/**
* Outputs a template.
*
* @param string $templateName
* @param boolean $sendHeaders if true, content type header is echoed
*/
public function display($templateName, $sendHeaders = true)
{
if ($sendHeaders) {
HeaderUtil::sendHeaders();
// call shouldDisplay event
if (!defined('NO_IMPORTS')) {
EventHandler::fireAction($this, 'shouldDisplay');
}
}
$compiledFilename = $this->getCompiledFilename($templateName);
$sourceFilename = $this->getSourceFilename($templateName);
// check if compilation is necessary
if (!$this->isCompiled($sourceFilename, $compiledFilename)) {
// compile
$this->compileTemplate($templateName, $sourceFilename, $compiledFilename);
}
include $compiledFilename;
if ($sendHeaders) {
// call didDisplay event
if (!defined('NO_IMPORTS')) {
EventHandler::fireAction($this, 'didDisplay');
}
}
}