Chciałem wstawić na stronie opartej na Smartach dane z MySQLa. Nie wiem niestety jak je wstawić do szablonu.
Próbowałem zrobić to w taki sposób:
<?php include "config.php"; $footer = $setting[footer]; // ładwanie biblioteki Smarty require_once(SMARTY_DIR . 'Smarty.class.php'); $smarty = new Smarty(); $smarty->template_dir = 'template/templates/'; $smarty->compile_dir = 'template/templates_c/'; $smarty->config_dir = 'template/configs/'; $smarty->cache_dir = 'template/cache/'; $smarty->assign('footer','$footer'); $smarty->display('index.tpl'); ?>
Ale wyświetla mi się nie zawartość zmiennej tylko poprostu $setting[footer]