本文整理汇总了PHP中VanillaController类的典型用法代码示例。如果您正苦于以下问题:PHP VanillaController类的具体用法?PHP VanillaController怎么用?PHP VanillaController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VanillaController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Initialize
public function Initialize()
{
parent::Initialize();
$this->AddCssFile('garden.css');
if ($this->Menu) {
$this->Menu->HighlightRoute('/garden/settings');
}
}
示例2: Initialize
public function Initialize()
{
parent::Initialize();
$this->ShowOptions = TRUE;
$this->Menu->HighlightRoute('/discussions');
$this->AddCssFile('vanilla.css');
$this->AddJsFile('/js/library/jquery.gardenmorepager.js');
}
示例3: 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');
}
}
示例4: Initialize
public function Initialize()
{
parent::Initialize();
$this->ShowOptions = TRUE;
$this->Menu->HighlightRoute('/discussions');
$this->AddCssFile('vanilla.css');
$this->AddJsFile('bookmark.js');
$this->AddJsFile('discussions.js');
$this->AddJsFile('jquery.menu.js');
$this->AddJsFile('options.js');
$this->AddJsFile('jquery.gardenmorepager.js');
$this->FireEvent('AfterInitialize');
}
示例5: 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->AddCssFile('vanilla.css');
$this->AddModule('NewDiscussionModule');
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->CategoryModel = new CategoryModel();
}
示例7: Initialize
public function Initialize()
{
parent::Initialize();
$this->Menu->HighlightRoute('/discussions');
}
示例8: Initialize
public function Initialize()
{
parent::Initialize();
$this->AddCssFile('vanilla.css');
}
示例9: 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');
}
示例10: 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');
}
示例11: Initialize
/**
* Highlight route.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function Initialize()
{
parent::Initialize();
if ($this->Menu) {
$this->Menu->HighlightRoute('/categories');
}
}
示例12: 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';
}
示例13: data
/**
* {@inheritdoc}
*/
public function data($Path, $Default = '')
{
if (isset($this->Data[$Path])) {
return $this->Data[$Path];
}
switch ($Path) {
case 'Categories':
if ($this->categoriesCompatibilityCallback instanceof \Closure) {
deprecated('Categories', 'CategoryTree');
$this->Data['Categories'] = $categories = call_user_func($this->categoriesCompatibilityCallback);
return $categories;
}
return $Default;
default:
return parent::data($Path, $Default);
}
}
示例14: 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('ImageResized', T('This image has been resized to fit in the page. Click to enlarge.'));
$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');
}
示例15: Initialize
/**
* Highlight route.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function Initialize()
{
parent::Initialize();
if ($this->Menu) {
$this->Menu->HighlightRoute('/categories');
}
$this->CountCommentsPerPage = C('Vanilla.Comments.PerPage', 30);
}