本文整理汇总了PHP中PHPTAL::restoreIncludePath方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPTAL::restoreIncludePath方法的具体用法?PHP PHPTAL::restoreIncludePath怎么用?PHP PHPTAL::restoreIncludePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPTAL
的用法示例。
在下文中一共展示了PHPTAL::restoreIncludePath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSource
/**
* Set template from source.
*
* Should be used only with temporary template sources.
* Use setTemplate() or addSourceResolver() whenever possible.
*
* @param string $src The phptal template source.
* @param string $path Fake and 'unique' template path.
* @return $this
*/
public function setSource($src, $path = false)
{
PHPTAL::setIncludePath();
require_once 'PHPTAL/StringSource.php';
PHPTAL::restoreIncludePath();
if (!$path) {
$path = PHPTAL_StringSource::NO_PATH_PREFIX . md5($src) . '>';
}
$this->_prepared = false;
$this->_functionName = null;
$this->_codeFile = null;
$this->_source = new PHPTAL_StringSource($src, $path);
$this->_path = $path;
return $this;
}
示例2: initializeGroups
/**
* Ensures that $this->groups works.
*
* Groups are rarely-used feature, which is why they're lazily loaded.
*/
private function initializeGroups()
{
if (!$this->uses_groups) {
if (!class_exists('PHPTAL_RepeatControllerGroups')) {
PHPTAL::setIncludePath();
require_once "PHPTAL/RepeatControllerGroups.php";
PHPTAL::restoreIncludePath();
}
$this->groups = new PHPTAL_RepeatControllerGroups();
$this->uses_groups = true;
}
}
示例3: __construct
/**
* PHPTAL templating engine
*
* PHP Version 5
*
* @category HTML
* @package PHPTAL
* @author Laurent Bedubourg <lbedubourg@motion-twin.com>
* @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
* @version SVN: $Id: FileSourceResolver.php 731 2009-09-25 16:31:56Z kornel $
* @link http://phptal.org/
*/
PHPTAL::setIncludePath();
require_once 'PHPTAL/SourceResolver.php';
PHPTAL::restoreIncludePath();
/**
* Finds template on disk by looking through repositories first
*
* @package PHPTAL
*/
class PHPTAL_FileSourceResolver implements PHPTAL_SourceResolver
{
public function __construct($repositories)
{
$this->_repositories = $repositories;
}
public function resolve($path)
{
foreach ($this->_repositories as $repository) {
$file = $repository . DIRECTORY_SEPARATOR . $path;