PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
localhost
Forum Commoner
Posts: 43 Joined: Tue Dec 07, 2004 4:52 am
Location: islamabad
Contact:
Post
by localhost » Thu May 05, 2005 3:52 am
The display function is not working
my director structure is d:\projects\websites\test
and smarty class is placed at d:\projects\websites\test\smarty
i am using smarty-2.5.0
Code: Select all
define('SMARTY_DIR',"smarty/");
if(include(SMARTY_DIR.'Smarty.class.php'))
echo "success";
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = true;
$smarty->template_dir = 'smarty/templates';
$smarty->compile_dir = 'smarty/templates_c';
$smarty->cache_dir = 'smarty/cache';
$smarty->config_dir = 'smarty/configs';
$smarty->assign('Username', 'John Doe');
$smarty->display('index.tpl');
phpScott
DevNet Resident
Posts: 1206 Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.
Post
by phpScott » Thu May 05, 2005 4:29 am
either put a / if front of smarty in your define or use an absolute reference to it's location.
localhost
Forum Commoner
Posts: 43 Joined: Tue Dec 07, 2004 4:52 am
Location: islamabad
Contact:
Post
by localhost » Thu May 05, 2005 4:59 am
i put the absolute path i.e
Code: Select all
include('d:projects/websites/test/smarty/Smarty.class.php');
but still it doesn't work.i am not recieving any errors but there is no out put either
phpScott
DevNet Resident
Posts: 1206 Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.
Post
by phpScott » Thu May 05, 2005 5:08 am
i think you are missing th e/ after d:
if not try
localhost
Forum Commoner
Posts: 43 Joined: Tue Dec 07, 2004 4:52 am
Location: islamabad
Contact:
Post
by localhost » Thu May 05, 2005 5:13 am
Done that, the path i think is just fine because browser does prints success
Code: Select all
define('SMARTY_DIR',"./smarty/");
if(include(SMARTY_DIR."Smarty.class.php"))
echo "success";
phpScott
DevNet Resident
Posts: 1206 Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.
Post
by phpScott » Thu May 05, 2005 5:18 am
I haven't used smarty before so I can't help you any further. sorry