ผมบังเิอิญไปเจอวิธีการที่จะเรียก Smarty library ที่น่าสนใจ สะดวกมากเวลาที่กำลังพัฒนาโปรแกรม เพราะไม่ต้องระบุ path เลย แต่เมื่อพัฒนาโปรแกรมเสร็จแล้วก็ควรแก้ไข path ให้ถูกต้องครับ
<?php
// SMARTY Section
define('SMARTY_DIR',str_replace("\","/",getcwd()).'/Smarty-2.6.19/libs/');
require_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = str_replace("\","/",getcwd()).'/templates/';
$smarty->compile_dir = str_replace("\","/",getcwd()).'/templates_c/';
$smarty->config_dir = str_replace("\","/",getcwd()).'/configs/';
$smarty->cache_dir = str_replace("\","/",getcwd()).'/cache/';
//** un-comment the following line to show the debug console
//$smarty->debugging = true;
?>