本文整理汇总了PHP中SSViewer::parseTemplateContent方法的典型用法代码示例。如果您正苦于以下问题:PHP SSViewer::parseTemplateContent方法的具体用法?PHP SSViewer::parseTemplateContent怎么用?PHP SSViewer::parseTemplateContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SSViewer
的用法示例。
在下文中一共展示了SSViewer::parseTemplateContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process($item) {
$template = SSViewer::parseTemplateContent($this->content);
$tmpFile = tempnam(TEMP_FOLDER,"");
$fh = fopen($tmpFile, 'w');
fwrite($fh, $template);
fclose($fh);
if(isset($_GET['showtemplate']) && $_GET['showtemplate']) {
$lines = file($tmpFile);
echo "<h2>Template: $tmpFile</h2>";
echo "<pre>";
foreach($lines as $num => $line) {
echo str_pad($num+1,5) . htmlentities($line);
}
echo "</pre>";
}
$itemStack = array();
$val = "";
include($tmpFile);
unlink($tmpFile);
return $val;
}
示例2: process
public function process($item, $arguments = null)
{
if ($arguments && $arguments instanceof Zend_Cache_Core) {
Deprecation::notice('3.0', 'Use setPartialCacheStore to override the partial cache storage backend, ' . 'the second argument to process is now an array of variables.');
$this->setPartialCacheStore($arguments);
$arguments = null;
}
$template = SSViewer::parseTemplateContent($this->content, "string sha1=" . sha1($this->content));
$tmpFile = tempnam(TEMP_FOLDER, "");
$fh = fopen($tmpFile, 'w');
fwrite($fh, $template);
fclose($fh);
$val = $this->includeGeneratedTemplate($tmpFile, $item, $arguments, null);
unlink($tmpFile);
return $val;
}
示例3: process
public function process($item, $cache = null)
{
$template = SSViewer::parseTemplateContent($this->content, "string sha1=" . sha1($this->content));
$tmpFile = tempnam(TEMP_FOLDER, "");
$fh = fopen($tmpFile, 'w');
fwrite($fh, $template);
fclose($fh);
if (isset($_GET['showtemplate']) && $_GET['showtemplate']) {
$lines = file($tmpFile);
echo "<h2>Template: {$tmpFile}</h2>";
echo "<pre>";
foreach ($lines as $num => $line) {
echo str_pad($num + 1, 5) . htmlentities($line);
}
echo "</pre>";
}
$itemStack = array();
$val = "";
$valStack = array();
$cache = SS_Cache::factory('cacheblock');
include $tmpFile;
unlink($tmpFile);
return $val;
}