本文整理汇总了PHP中Gdn_Controller::AddJSFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Controller::AddJSFile方法的具体用法?PHP Gdn_Controller::AddJSFile怎么用?PHP Gdn_Controller::AddJSFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Controller
的用法示例。
在下文中一共展示了Gdn_Controller::AddJSFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Controller_Index
/**
* List all tags and allow searching
*
* @param Gdn_Controller $Sender
*/
public function Controller_Index($Sender)
{
$Sender->Title('Tagging');
$Sender->AddSideMenu('settings/tagging');
$Sender->AddCSSFile('plugins/Tagging/design/tagadmin.css');
$Sender->AddJSFile('plugins/Tagging/js/admin.js');
$SQL = Gdn::SQL();
$Sender->Form->Method = 'get';
$Sender->Form->InputPrefix = '';
//$Sender->Form->Action = '/settings/tagging';
list($Offset, $Limit) = OffsetLimit($Sender->Request->Get('Page'), 100);
$Sender->SetData('_Limit', $Limit);
if ($Search = $Sender->Request->Get('Search')) {
$SQL->Like('Name', $Search, 'right');
}
$Data = $SQL->Select('t.*')->From('Tag t')->OrderBy('t.Name', 'asc')->OrderBy('t.CountDiscussions', 'desc')->Limit($Limit, $Offset)->Get()->ResultArray();
$Sender->SetData('Tags', $Data);
if ($Search = $Sender->Request->Get('Search')) {
$SQL->Like('Name', $Search, 'right');
}
$Sender->SetData('RecordCount', $SQL->GetCount('Tag'));
$Sender->Render('tagging', '', 'plugins/Tagging');
}
示例2: SettingsController_Tagging_Create
/**
* Tag management (let admins rename tags, remove tags, etc).
* TODO: manage the Plugins.Tagging.Required boolean setting that makes tagging required or not.
* @param Gdn_Controller $Sender
*/
public function SettingsController_Tagging_Create($Sender, $Args) {
$Sender->Permission('Garden.Settings.Manage');
$Sender->Title('Tagging');
$Sender->AddSideMenu('settings/tagging');
$Sender->AddCSSFile('plugins/Tagging/design/tagadmin.css');
$Sender->AddJSFile('plugins/Tagging/admin.js');
$SQL = Gdn::SQL();
list($Offset, $Limit) = OffsetLimit($Sender->Request->Get('Page'), 100);
$Sender->SetData('_Limit', $Limit);
$Sender->SetData('Tags', $SQL
->Select('t.*')
->From('Tag t')
->OrderBy('t.Name', 'asc')
->OrderBy('t.CountDiscussions', 'desc')
->Limit($Limit, $Offset)
->Get()->ResultArray());
$Sender->SetData('RecordCount', $SQL->GetCount('Tag'));
$Sender->Render('Tagging', '', 'plugins/Tagging');
}
示例3: base_render_before
/**
*
*
* @param Gdn_Controller $Sender
* @param $Args
*/
public function base_render_before($Sender, $Args)
{
if (!Gdn::Session()->UserID) {
$Sender->AddJSFile('jsconnect.js', 'plugins/jsconnect');
$Sender->AddCssFile('jsconnect.css', 'plugins/jsconnect');
}
}