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


PHP Language::getActiveLanguages方法代碼示例

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


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

示例1: getActiveLanguages

 /**
  * Get the active languages
  *
  * @deprecated
  *
  * @return array
  */
 public static function getActiveLanguages()
 {
     trigger_error('Backend\\Core\\Engine\\Language is deprecated.
          It has been moved to Backend\\Core\\Language\\Language', E_USER_DEPRECATED);
     return parent::getActiveLanguages();
 }
開發者ID:forkcms,項目名稱:forkcms,代碼行數:13,代碼來源:Language.php

示例2: getURL

 /**
  * Convert a var into a URL
  * syntax: {{ geturl:<action>[:<module>] }}
  *
  * @param string $action The action to build the URL for.
  * @param string $module The module to build the URL for.
  * @param string $suffix A string to append.
  * @param string $language A language code
  *
  * @return string
  */
 public static function getURL($action = null, $module = null, $suffix = null, $language = null)
 {
     if (!in_array($language, BackendLanguage::getActiveLanguages())) {
         $language = BackendLanguage::getWorkingLanguage();
     }
     $action = $action !== null ? (string) $action : null;
     $module = $module !== null ? (string) $module : null;
     return BackendModel::createURLForAction($action, $module, $language) . $suffix;
 }
開發者ID:forkcms,項目名稱:forkcms,代碼行數:20,代碼來源:TemplateModifiers.php

示例3: installModule

 /**
  * Install a module.
  *
  * @param string $module   The name of the module to be installed.
  */
 public static function installModule($module)
 {
     $class = 'Backend\\Modules\\' . $module . '\\Installer\\Installer';
     $variables = array();
     // run installer
     $installer = new $class(BackendModel::getContainer()->get('database'), BL::getActiveLanguages(), array_keys(BL::getInterfaceLanguages()), false, $variables);
     $installer->install();
     // clear the cache so locale (and so much more) gets rebuilt
     self::clearCache();
 }
開發者ID:forkcms,項目名稱:forkcms,代碼行數:15,代碼來源:Model.php

示例4: getInfo

 /**
  * Get info about the site.
  *
  * @return array
  */
 public static function getInfo()
 {
     trigger_error('The api is deprecated and will be removed in version 5', E_USER_DEPRECATED);
     if (BaseAPI::isAuthorized()) {
         $info = array();
         // get all languages
         $languages = BackendLanguage::getActiveLanguages();
         $default = Model::get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);
         // loop languages
         foreach ($languages as $language) {
             // create array
             $var = array();
             // set attributes
             $var['language']['@attributes']['language'] = $language;
             if ($language == $default) {
                 $var['language']['@attributes']['is_default'] = 'true';
             }
             // set attributes
             $var['language']['title'] = Model::get('fork.settings')->get('Core', 'site_title_' . $language);
             $var['language']['url'] = SITE_URL . '/' . $language;
             // add
             $info['languages'][] = $var;
         }
         return $info;
     }
 }
開發者ID:forkcms,項目名稱:forkcms,代碼行數:31,代碼來源:Api.php


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