|
|
|
| Кто подскажет как подключить смарти к php ? где и что нужно править? | |
|
|
|
|
|
|
|
для: nek-v
(26.03.2008 в 01:05)
| | по идее Вам нужно в создаваемые файлы включать
<?
require '../libs/Smarty.class.php';
?>
|
| |
|
|
|
|
|
|
|
для: nek-v
(26.03.2008 в 01:05)
| | common.php:
define("SMARTY_DIR", MDB_ROOTDIR . "/smarty/");
$config->templatedir = MDB_ROOTDIR . $conf['tpldir'];
require(SMARTY_DIR."Smarty.class.php");
class dynamicPage extends Smarty {
function dynamicPage() {
global $config;
$this->Smarty();
$this->template_dir = $config->templatedir;
$this->compile_dir = SMARTY_DIR."templates_c/";
$this->config_dir = SMARTY_DIR."configs/";
$this->cache_dir = SMARTY_DIR."cache/";
$this->caching = FALSE;
$this->assign("app_name","dynamicPage");
}
}
|
define'ы подкрути под себя
script.php (в конец)
// start template engine
$smarty = new dynamicPage;
$smarty->assign("variable_or_array", $variable_or_array);
$smarty->display("template_with_html.tpl");
|
P.S. При чем тут apache? | |
|
|
|
|
|
|
|
для: mtxd
(27.03.2008 в 18:49)
| | Ммм...
О как...
Спасибо всем... | |
|
|
|