本文整理汇总了PHP中VanillaController::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP VanillaController::initialize方法的具体用法?PHP VanillaController::initialize怎么用?PHP VanillaController::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VanillaController
的用法示例。
在下文中一共展示了VanillaController::initialize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
public function initialize()
{
parent::initialize();
/**
* The default Cache-Control header does not include no-store, which can cause issues with outdated category
* information (e.g. counts). The same check is performed here as in Gdn_Controller before the Cache-Control
* header is added, but this value includes the no-store specifier.
*/
if (Gdn::session()->isValid()) {
$this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
}
}
示例2: initialize
/**
* Highlight route & add common JS definitions.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->addDefinition('ConfirmDeleteCommentHeading', t('ConfirmDeleteCommentHeading', 'Delete Comment'));
$this->addDefinition('ConfirmDeleteCommentText', t('ConfirmDeleteCommentText', 'Are you sure you want to delete this comment?'));
$this->Menu->highlightRoute('/discussions');
}
示例3: initialize
/**
* Include CSS for all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->CssClass = 'NoPanel';
}
示例4: initialize
/**
* Highlight route and include JS, CSS, and modules used by all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->ShowOptions = true;
$this->Menu->highlightRoute('/discussions');
$this->addJsFile('discussions.js');
// Inform moderator of checked comments in this discussion
$CheckedDiscussions = Gdn::session()->getAttribute('CheckedDiscussions', array());
if (count($CheckedDiscussions) > 0) {
ModerationController::InformCheckedDiscussions($this);
}
$this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
$this->fireEvent('AfterInitialize');
}
示例5: initialize
/**
* Highlight route and include JS, CSS, and modules used by all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->ShowOptions = true;
$this->Menu->highlightRoute('/discussions');
$this->addJsFile('discussions.js');
// Inform moderator of checked comments in this discussion
$CheckedDiscussions = Gdn::session()->getAttribute('CheckedDiscussions', array());
if (count($CheckedDiscussions) > 0) {
ModerationController::InformCheckedDiscussions($this);
}
$this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
/**
* The default Cache-Control header does not include no-store, which can cause issues (e.g. inaccurate unread
* status or new comment counts) when users visit the discussion list via the browser's back button. The same
* check is performed here as in Gdn_Controller before the Cache-Control header is added, but this value
* includes the no-store specifier.
*/
if (Gdn::session()->isValid()) {
$this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
}
$this->fireEvent('AfterInitialize');
}
示例6: initialize
/**
* Include CSS for all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->addModule('NewDiscussionModule');
}
示例7: initialize
/**
* Highlight route.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
if (!c('Vanilla.Categories.Use')) {
redirect('/discussions');
}
if ($this->Menu) {
$this->Menu->highlightRoute('/categories');
}
$this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
}
示例8: initialize
/**
* Highlight route.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
if (!c('Vanilla.Categories.Use')) {
redirect('/discussions');
}
if ($this->Menu) {
$this->Menu->highlightRoute('/categories');
}
$this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
/**
* The default Cache-Control header does not include no-store, which can cause issues with outdated category
* information (e.g. counts). The same check is performed here as in Gdn_Controller before the Cache-Control
* header is added, but this value includes the no-store specifier.
*/
if (Gdn::session()->isValid()) {
$this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
}
}
示例9: initialize
/**
* Include CSS for all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
parent::initialize();
$this->addModule('NewDiscussionModule');
$this->CssClass = 'NoPanel';
}