PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- class templates
- {
- var $dir = './templates/Default/';
- var $template = false;
- public $inc_tpl;
- //-------- Функйия загрузки шаблона --------//
- function load($tpl_name)
- {
- // проверка на сушествование шаблона
- {
- }
- // загружаем
- // подключение css
- if($arr[2][7] == 'css')
- {
- foreach($arr[0] as $key => $val)
- {
- $this->template = str_replace('['.$val.']', '<link rel="stylesheet" href="'.$val.'" type="text/css" />', $this->template);
- }
- }
- // подключение js
- if($arr[2][7] == 'js')
- {
- foreach($arr[0] as $key => $val)
- {
- $this->template = str_replace('['.$val.']','<script type="text/javascript" src="'.$val.'"></script>', $this->template);
- }
- }
- // инклудим файл тегом file
- foreach($inc[0] as $k => $v)
- {
- }
- return true;
- }
- function set($name, $val)
- {
- $this->vars[$name] = $val;
- }
- function inc($tpl_name)
- {
- foreach($this->vars as $k => $v)
- {
- }
- return $this->inc_tpl;
- }
- function parse()
- {
- return false;
- foreach($this->vars as $key => $val)
- {
- }
- echo $this->template;
- return true;
- }
- }
- $tpl = new templates;
- ?>