当前位置: 首页>>代码示例>>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;未经允许,请勿转载。