本文整理汇总了PHP中FD::document方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::document方法的具体用法?PHP FD::document怎么用?PHP FD::document使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FD
的用法示例。
在下文中一共展示了FD::document方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($params)
{
$this->params = $params;
// Process scripts
$page = FD::page();
$page->processScripts();
// Process styling
$doc = FD::document();
$doc->init();
}
示例2: loadAssets
/**
* Loads required assets
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function loadAssets()
{
if (!$this->exists()) {
return false;
}
$document = JFactory::getDocument();
if ($document->getType() == 'html') {
// We also need to render the styling from EasySocial.
FD::document()->init();
$page = FD::page();
$page->processScripts();
$css = rtrim(JURI::root(), '/') . '/plugins/content/easysocial/assets/style.css';
$document->addStylesheet($css);
}
}
示例3: end
/**
* This is the ending point of the page library.
*
* @access public
* @param null
* @return null
*/
public function end($options = array())
{
// Initialize required dependencies.
FD::document()->init($options);
$processStylesheets = isset($options['processStylesheets']) ? $options['processStylesheets'] : true;
// @task: Process any scripts that needs to be injected into the head.
if ($processStylesheets) {
$this->processStylesheets();
}
// @task: Process any scripts that needs to be injected into the head.
$this->processScripts();
// @task: Process the document title.
$this->processTitle();
// @task: Process opengraph tags
FD::opengraph()->render();
// @task: Trigger profiler's end.
if ($this->config->get('general.profiler')) {
FD::profiler()->end();
}
// Additional triggers to be processed when the page starts.
// $dispatcher = FD::dispatcher();
// Trigger: onComponentStart
// $dispatcher->trigger('user', 'onComponentEnd', array());
}
示例4: jimport
jimport('joomla.filesystem.file');
if (!JFile::exists($file)) {
return;
}
// Include the engine file.
require_once $file;
// Check if Foundry exists
if (!FD::exists()) {
FD::language()->loadSite();
echo JText::_('COM_EASYSOCIAL_FOUNDRY_DEPENDENCY_MISSING');
return;
}
$option = JRequest::getVar('option');
if ($option == 'com_easysocial' && !$params->get('show_on_easysocial', false)) {
return;
}
// Load our css
FD::document()->init();
// Load up EasySocial's language file
FD::language()->loadSite();
// Load up the module engine
$modules = FD::modules('mod_easysocial_toolbar');
$modules->loadComponentScripts();
// We need these packages
$modules->addDependency('css', 'javascript');
// Get the layout to use.
$layout = $params->get('layout', 'default');
$suffix = $params->get('suffix', '');
$toolbar = FD::get('Toolbar');
$options = array('forceoption' => true, 'toolbar' => true, 'dashboard' => $params->get('show_dashboard', true), 'friends' => $params->get('show_friends', true), 'conversations' => $params->get('show_conversations', true), 'notifications' => $params->get('show_notifications', true), 'search' => $params->get('show_search', true), 'login' => $params->get('show_login', true), 'profile' => $params->get('show_profile', true), 'responsive' => $params->get('responsive', true));
require JModuleHelper::getLayoutPath('mod_easysocial_toolbar', $layout);
示例5: loadComponentStylesheets
public function loadComponentStylesheets()
{
FD::document()->initStylesheets();
}