本文整理匯總了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');
}
}