Jump to content

Installing Smarty


kostakondras

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/225592-installing-smarty/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.