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