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


PHP Bootstrap::getConfig方法代碼示例

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


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

示例1: initView

 /**
  * 視圖路徑配置
  *
  * @param array $options
  * @return \Ku\Layout
  */
 public function initView(array $options = NULL)
 {
     parent::initView($options);
     $view = $this->getView();
     if (!empty($this->layout)) {
         $config = \Bootstrap::getConfig();
         $prePath = $config->get('application.directory');
         if ($this->layoutFollowModule and 'Index' !== $this->getModuleName()) {
             $prePath .= 'modules' . DS . $this->getModuleName() . DS;
         }
         $view->setLayoutPath($prePath . 'views' . DS . 'layouts');
         $view->setLayout($this->layout);
     }
     return $view;
 }
開發者ID:lawruence,項目名稱:yafsample.lawruence.github.com,代碼行數:21,代碼來源:Appabstract.php

示例2: microtime

<?php

$_SERVER['backend_start'] = microtime(true);
include __DIR__ . '/backend/include/all.php';
autoload([__DIR__ . '/classes', __DIR__ . '/controllers']);
$config = json_config(__DIR__ . '/config/application.json');
$bootstrap = new Bootstrap($config);
$root = $bootstrap->getRoot();
$uri = $_SERVER['REQUEST_URI'];
if ($pos = strpos($uri, '?')) {
    $uri = substr($uri, 0, $pos);
}
$uri = substr($uri, strlen($root));
$q = urldecode(trim(str_replace(['-', '/', "'"], ' ', $uri)));
$google_part = '';
$description = $q ? str_replace('{q}', $q, $bootstrap->getConfig('page.description')) : $bootstrap->getConfig('page.description0');
if (isset($_GET['_google']) || isset($_SERVER['HTTP_USER_AGENT']) && strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'google')) {
    if ($q) {
        $google_part = '<h1>' . $q . '</h1>' . "\n";
        $template = new templateController();
        $template->init();
        $holidays = new holidaysController(0, ['q' => $q]);
        $holidays->init();
        $tmpl = $template->get(false);
        $tmpl = preg_replace('~\\[if:[^\\]]+\\]~', '', $tmpl);
        $tmpl = preg_replace('~\\[endif:[^\\]]+\\]~', '', $tmpl);
        $tmpl = preg_replace('~\\[loop:[^\\]]+\\]~', '', $tmpl);
        $tmpl = preg_replace('~\\[endloop:[^\\]]+\\]~', '', $tmpl);
        $tmpl = str_replace('style="display:none"', '', $tmpl);
        $result = $holidays->get(10);
        foreach ($result['data'] as $rec) {
開發者ID:WebKameleon,項目名稱:wakacje,代碼行數:31,代碼來源:index.php

示例3: Bootstrap

        echo $js;
    } else {
        include __DIR__ . '/html.php';
    }
    die;
}
foreach (['facebook', 'google', 'twitterbot', 'pinterest', 'msnbot'] as $agent) {
    if (isset($_SERVER['HTTP_USER_AGENT']) && strstr(strtolower($_SERVER['HTTP_USER_AGENT']), $agent)) {
        include __DIR__ . '/html.php';
        die;
    }
}
include __DIR__ . '/rest/library/backend/include/all.php';
if ($pass) {
    simple_pass($pass);
}
autoload([__DIR__ . '/rest/class', __DIR__ . '/rest/models', __DIR__ . '/rest/controllers']);
$config = json_config(__DIR__ . '/rest/config/application.json');
$bootstrap = new Bootstrap($config);
$geo = Tools::geoip();
$locale = 'i18n/angular-locale_' . $bootstrap->lang . '-' . strtolower($geo['location']['country']) . '.js';
if (isset($_SERVER['SERVER_SOFTWARE']) && strstr(strtolower($_SERVER['SERVER_SOFTWARE']), 'engine') && substr($_SERVER['REQUEST_URI'], 0, 6) != '/test/') {
    $html = file_get_contents(__DIR__ . '/index.html');
    $html = str_replace('facebook.net/en_US/sdk.js', 'facebook.net/' . $bootstrap->lang . '_' . strtoupper($geo['location']['country']) . '/sdk.js', $html);
    $html = str_replace('bower_components/angular-i18n/angular-locale_en-us.js', $locale, $html);
    $html = str_replace('<title>epapu</title>', '<title>' . Tools::translate('page-title') . '</title>', $html);
    $html = str_replace('AIzaSyB7iQMqTOfotqClUkAgVp6_w46-f0F7VEc', $bootstrap->getConfig('maps.api_key'), $html);
    die($html);
} else {
    include __DIR__ . '/test.php';
}
開發者ID:podstawski,項目名稱:papu,代碼行數:31,代碼來源:index.php


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