本文整理匯總了PHP中XTemplate::restart方法的典型用法代碼示例。如果您正苦於以下問題:PHP XTemplate::restart方法的具體用法?PHP XTemplate::restart怎麽用?PHP XTemplate::restart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XTemplate
的用法示例。
在下文中一共展示了XTemplate::restart方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: restart
/**
* Override of parent restart method
*
* @access public
* @param string $file Template file to work on
* @param string $tpldir Location of template files
* @param array $files Filenames lookup
* @param string $mainblock Name of main block in the template
* @param boolean $autosetup If true, run setup() as part of restarting
* @param string $tag_start {
* @param string $tag_end }
* @param int $cache_expiry Seconds to cache for
* @param string $cache_unique Unique file id (e.g. session_id())
* @param string $cache_dir Cache folder
* @param string $cache_ext Cache file extension
*/
public function restart($file, $tpldir = '', $files = null, $mainblock = 'main', $autosetup = true, $tag_start = '{', $tag_end = '}', $cache_expiry = 0, $cache_unique = '', $cache_dir = './xcache', $cache_ext = '.xcache')
{
if ($cache_expiry > 0) {
$this->cache_expiry = $cache_expiry;
}
if (!empty($cache_unique)) {
if (!preg_match('/^\\./', $cache_unique)) {
$cache_unique = '.' . $cache_unique;
}
$this->cache_unique = $cache_unique;
}
if (!empty($cache_dir)) {
$this->cache_dir = $cache_dir;
}
if (!empty($cache_ext)) {
if (!preg_match('/^\\./', $cache_ext)) {
$cache_ext = '.' . $cache_ext;
}
$this->cache_ext = $cache_ext;
}
// Call parent restart method but don't run setup yet!
parent::restart($file, $tpldir, $files, $mainblock, false, $tag_start, $tag_end);
if ($this->cache_expiry > 0) {
$this->read_template_cache();
}
if (!$this->_template_is_cached && $autosetup) {
$this->setup();
}
}