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


PHP l::data方法代碼示例

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


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

示例1: configure

 public static function configure()
 {
     if (is_null(static::$site)) {
         static::$site = kirby::panelsetup();
     }
     // load all available routes
     static::$routes = array_merge(static::$routes, require root('panel.app.routes') . DS . 'api.php');
     static::$routes = array_merge(static::$routes, require root('panel.app.routes') . DS . 'views.php');
     // setup the blueprint root
     blueprint::$root = c::get('root.site') . DS . 'blueprints';
     // start the router
     static::$router = new Router();
     static::$router->register(static::$routes);
     // content language switcher variable
     if (static::$site->multilang()) {
         if ($language = server::get('http_language') or $language = s::get('lang')) {
             static::$site->visit('/', $language);
         }
         app::$language = static::$site->language()->code();
         s::set('lang', app::$language);
     }
     // load the interface language file
     if (static::$site->user()) {
         $languageCode = static::$site->user()->language();
     } else {
         $languageCode = c::get('panel.language', 'en');
     }
     // validate the language code
     if (!in_array($languageCode, static::languages()->keys())) {
         $languageCode = 'en';
     }
     // store the interface language
     app::$interfaceLanguage = $languageCode;
     $language = (require root('panel.app.languages') . DS . $languageCode . '.php');
     // set all language variables
     l::$data = $language['data'];
     // register router filters
     static::$router->filter('auth', function () {
         if (!app::$site->user()) {
             go('panel/login');
         }
     });
     // check for a completed installation
     static::$router->filter('isInstalled', function () {
         if (app::$site->users()->count() == 0) {
             go('panel/install');
         }
     });
     // only use the fragments of the path without params
     static::$path = implode('/', (array) url::fragments(detect::path()));
 }
開發者ID:kompuser,項目名稱:panel,代碼行數:51,代碼來源:app.php

示例2: localize

 /**
  * Load language files if available.
  */
 protected function localize()
 {
     $finder = $this->finder();
     $config = $this->config();
     $base = 'en';
     $root = $finder->languages();
     $current = $this->site->multilang() ? $this->site->language() : $config->get('language', $base);
     if (file_exists($root . DS . $base . '.php')) {
         $localization = $finder->load($base, 'languages');
         $localization = $localization['data'];
         if ($current !== 'en' && file_exists($root . DS . $current . '.php')) {
             $translation = $finder->load($current, 'languages');
             $localization = array_merge($localization, $translation['data']);
         }
         l::$data = array_merge(l::$data, $localization);
     }
 }
開發者ID:buditanrim,項目名稱:kirby-comments,代碼行數:20,代碼來源:plugin.php

示例3: i18n

 public function i18n()
 {
     // load the interface language file
     if ($user = $this->site()->user()) {
         $this->language = $user->language();
     } else {
         $this->language = $this->kirby()->option('panel.language', 'en');
     }
     $translation = (require $this->roots()->languages() . DS . 'en.php');
     $translation = array_merge($translation, require $this->roots()->languages() . DS . $this->language . '.php');
     // set all language variables
     l::$data = $translation['data'];
 }
開發者ID:muten84,項目名稱:luigibifulco.it,代碼行數:13,代碼來源:panel.php

示例4: i18n

 public function i18n()
 {
     // load the interface language file
     if ($user = $this->site()->user()) {
         $this->language = $user->language();
     } else {
         $this->language = $this->kirby()->option('panel.language', 'en');
     }
     $translation = (require $this->roots()->languages() . DS . 'en.php');
     $translation = a::merge($translation, require $this->roots()->languages() . DS . $this->language . '.php');
     // set all language variables
     l::$data = $translation['data'];
     // set language direction (ltr is default)
     if (isset($translation['direction']) and $translation['direction'] == 'rtl') {
         l::set('language.direction', 'rtl');
     } else {
         l::set('language.direction', 'ltr');
     }
 }
開發者ID:v1m0,項目名稱:kirby-f6,代碼行數:19,代碼來源:panel.php

示例5: load

 public function load()
 {
     return l::$data = data::read($this->root . DS . 'core.json');
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:4,代碼來源:translation.php


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