本文整理汇总了PHP中RainTPL::path_replace方法的典型用法代码示例。如果您正苦于以下问题:PHP RainTPL::path_replace方法的具体用法?PHP RainTPL::path_replace怎么用?PHP RainTPL::path_replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RainTPL
的用法示例。
在下文中一共展示了RainTPL::path_replace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor..
* PDOException throwable
*/
public function __construct($templateDirectory, $cacheDirectory, $templateExtension = 'html', $templatePrefix = '', $debug = false)
{
RainTPL::$tpl_dir = $templateDirectory;
// template directory
RainTPL::$cache_dir = $cacheDirectory;
// cache directory
RainTPL::$tpl_ext = $templateExtension;
RainTPL::$path_replace = false;
$this->rainTPL = new RainTPL();
$this->dataDispatcher = new DataDispatcher();
$this->tplDir = $templateDirectory;
$this->tplExt = $templateExtension;
$this->tplPrefix = $templatePrefix;
$this->debug = $debug;
}
示例2: exit
<?php
/* Copyright (c) 2014 Freeder
* Released under a MIT License.
* See the file LICENSE at the root of this repo for copying permission.
*/
$force_public = true;
// Allow JS loading while not logged in
require_once 'inc/init.php';
require_once 'inc/js.tpl.class.php';
if (!isset($_GET['script'])) {
exit('error');
}
$script = $_GET['script'];
RainTPL::$tpl_ext = 'js';
RainTPL::$path_replace = false;
$tpl = new JsTPL();
$tpl->assign('base_url', RainTPL::$base_url);
$tpl->draw($script);
示例3: initTemplate
/**
* 初始化模板
*
* @since 1.0.1
*
* @param bool $empty
*
* @return bool
*/
private function initTemplate($empty = false)
{
if ($empty) {
return true;
}
if (file_exists(FILE_PREFIX . 'content/theme/' . THEME . '/')) {
RainTPL::$tpl_dir = FILE_PREFIX . 'content/theme/' . THEME . '/';
RainTPL::$cache_dir = FILE_PREFIX . 'content/theme/' . THEME . '_cache/';
} else {
RainTPL::$tpl_dir = FILE_PREFIX . 'content/theme/default/';
RainTPL::$cache_dir = FILE_PREFIX . 'content/theme/default_cache/';
}
RainTPL::$tpl_ext = 'tpl.php';
RainTPL::$path_replace = false;
$this->tpl = new RainTPL();
}