Файл: system/classes/template.php
Строк: 30
<?php
class Template {
public $type;
public $format = '.html';
public $tpln = 'default';
public $html;
public $values = array();
public function __construct() {
// $this->type = browser_type();
$this->type = 'wap';
}
public function parse($tpl_name)
{
global $stylen;
if(empty($tpl_name) || !file_exists(TPL.'/themes/'.$this->type.'/'. $stylen .'/'.$tpl_name . $this->format))
{
return false;
}
else
{
$this->html = file_get_contents(TPL.'/themes/'.$this->type.'/'. $stylen .'/'.$tpl_name . $this->format);
}
}
public function set_value($key, $var)
{
$key = '{'.$key.'}';
$this->values[$key] = $var;
}
public function view()
{
foreach($this->values as $find => $replace)
{
$this->html = str_replace($find, $replace, $this->html);
}
echo @$this->html;
}
public function div($div, $content)
{
echo "<div class="{$div}">{$content}</div>n";
}
}