kostakondras Posted January 25, 2011 Share Posted January 25, 2011 I have just installed Smarty on my local server and am trying to get it to work. I have created 4 seperate folders as instructed in Beginning PHp book includes templates, configs, templates_c and cache folders. All these folders are inside the Smarty folder in C:/PHP/includes and the include_path directive is setup. When I try to run the template with the code below: <?php require_once("Smarty.class.php"); $smarty = new Smarty; $smarty->assign("title", "Welcome to your Smarty Page"); $smarty->assign("body", "As you can see, everything is working properly on the template side"); $smarty->display("welcome.tpl"); ?> The following error is returned: [25-Jan-2011 03:51:38] PHP Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'welcome.tpl'' in I thought it would search by default inside the templates folder however it doesn't. Is there any way to set it manually or what should I do? I have tried $smarty->template_dir="C:\PHP\includes\smarty\templates"; after creating the Smarty class however this does not seem to work either. Thank you in advance for the help, please ask any more questions that you require of myself. Regards Quote Link to comment Share on other sites More sharing options...
sunfighter Posted January 25, 2011 Share Posted January 25, 2011 It looks like you didn't set up the paths. Look here. This might help> http://www.smarty.net/quick_install Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.