當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JDocument::addHeadLink方法代碼示例

本文整理匯總了PHP中JDocument::addHeadLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDocument::addHeadLink方法的具體用法?PHP JDocument::addHeadLink怎麽用?PHP JDocument::addHeadLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JDocument的用法示例。


在下文中一共展示了JDocument::addHeadLink方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addCompiledStyleSheet

 /**
  * Depending on whether ThemeCustomiser has been enabled or not, adds directly LESS file instead of CSS or compiles LESS to CSS
  * @param (string) Path to LESS file
  * @param (bool) If true additional LESS variables from "jm_bootstrap_variables" parameter will be added
  * @param (bool) Indicates if ThemeCustomiser is being used
  */
 public function addCompiledStyleSheet($path, $useVars = true, $themer = false)
 {
     if ($themer) {
         //if (false){
         $this->attachThemeCustomiser($useVars);
         if ($lessPath = $this->getLessUrl($path)) {
             return $this->document->addHeadLink($lessPath, 'stylesheet/less');
         }
     } else {
         $path = $this->lessToCss($path, $useVars);
         if ($path) {
             return $this->document->addStyleSheet($path);
         }
     }
 }
開發者ID:andremarceloteixeira,項目名稱:relaixamento.com-local,代碼行數:21,代碼來源:template.php

示例2: before

 protected function before()
 {
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
     if (!$this->exists()) {
         KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
         throw new RuntimeException("Layout '{$this->input->getWord('view')}/{$this->input->getWord('layout', 'default')}' does not exist!", 404);
     }
     // Load language files.
     KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
     KunenaFactory::loadLanguage('com_kunena.templates');
     KunenaFactory::loadLanguage('com_kunena.models');
     KunenaFactory::loadLanguage('com_kunena.views');
     $this->me = KunenaUserHelper::getMyself();
     $this->config = KunenaConfig::getInstance();
     $this->document = JFactory::getDocument();
     $this->template = KunenaFactory::getTemplate();
     $this->template->initialize();
     if ($this->me->isAdmin()) {
         // Display warnings to the administrator if forum is either offline or debug has been turned on.
         if ($this->config->board_offline) {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_FORUM_IS_OFFLINE'), 'notice');
         }
         if ($this->config->debug) {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_WARNING_DEBUG'), 'notice');
         }
     }
     if ($this->me->isBanned()) {
         // Display warnings to the banned users.
         $banned = KunenaUserBan::getInstanceByUserid($this->me->userid, true);
         if (!$banned->isLifetime()) {
             $this->app->enqueueMessage(JText::sprintf('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS_EXPIRY', KunenaDate::getInstance($banned->expiration)->toKunena('date_today')), 'notice');
         } else {
             $this->app->enqueueMessage(JText::_('COM_KUNENA_POST_ERROR_USER_BANNED_NOACCESS'), 'notice');
         }
     }
     // Remove base and add canonical link.
     $this->document->setBase('');
     $this->document->addHeadLink(KunenaRoute::_(), 'canonical', 'rel', '');
     // Initialize breadcrumb.
     $this->breadcrumb = $this->app->getPathway();
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
 }
開發者ID:giabmf11,項目名稱:Kunena-Forum,代碼行數:42,代碼來源:display.php


注:本文中的JDocument::addHeadLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。