//index.php
include_once 'Router.php';
function new_template(){
$smarty = new Smarty();
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
$smarty->config_dir = 'configs';
$smarty->cache_dir = 'cache';
return $smarty;
}
$content = Router::process($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
$smarty = new_template();
$smarty->assign('content', $content);
$smarty->display('template-1.tpl');
?>
//template-1.tpl
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Template</title>
<link rel="stylesheet" type="text/css" href="D:/Server/OpenServer/domains/php.loc/templates/style.css">
</head>
<body>
<div class="header">Head</div>
<div>{$content}</div>
<div class="footer">Footer</div>
</body>
</html>
//style.css
.header {
background-color: black;
}
<link rel="stylesheet" type="text/css" href="D:/Server/OpenServer/domains/php.loc/templates/style.css">
<link rel="stylesheet" type="text/css" href="templates/style.css">
// Создаем и настраиваем Смарти
$this->smarty = new Smarty();
$this->smarty->compile_check = $this->config->smarty_compile_check;
$this->smarty->caching = $this->config->smarty_caching;
$this->smarty->cache_lifetime = $this->config->smarty_cache_lifetime;
$this->smarty->debugging = $this->config->smarty_debugging;
$this->smarty->error_reporting = E_ALL & ~E_NOTICE;
// Берем тему из настроек
$theme = $this->settings->theme;
$this->smarty->compile_dir = $this->config->root_dir.'/compiled/'.$theme;
$this->smarty->template_dir = $this->config->root_dir.'/design/'.$theme.'/html';
// Создаем папку для скомпилированных шаблонов текущей темы
if(!is_dir($this->smarty->compile_dir))
mkdir($this->smarty->compile_dir, 0777);
$this->smarty->cache_dir = 'cache';
<link rel="stylesheet" href="design/{$settings->theme|escape}/css/base.css">