|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
wantho Smarty Rookie
Joined: 21 Sep 2011 Posts: 8
|
Posted: Tue Feb 28, 2012 11:14 am Post subject: Novices question |
|
|
I have WAMP installed the root being c:\wamp\www
This file originallyhad a few compile errors: c:\wamp\www\myapp\smarty.php
<?php
//Use the absolute path for Smarty.class.php
$base_path= dirname(__FILE__);
require_once('c:\wamp\www\Smarty\Smarty.class.php');
$smarty = new Smarty();
$smarty->TemplateDir=$base_path.'\myapp\smarty\templates';
$smarty->CompileDir=$base_path.'\myapp\smarty\templates_c';
$smarty->CacheDir=$base_path.'\myapp\smarty\cache';
$smarty->ConfigDir=$base_path.'\myapp\smarty\configs';
?>
When I open 'myapp' on localhost I now get this...
I need help.
Notice: Undefined property: Smarty::$TemplateDir in C:\wamp\www\Smarty\Smarty.class.php on line 627
Notice: Undefined property: Smarty::$CompileDir in C:\wamp\www\Smarty\Smarty.class.php on line 627
Notice: Undefined property: Smarty::$CacheDir in C:\wamp\www\Smarty\Smarty.class.php on line 627
Notice: Undefined property: Smarty::$ConfigDir in C:\wamp\www\Smarty\Smarty.class.php on line 627
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in C:\wamp\www\Smarty\sysplugins\smarty_internal_templatebase.php:116 Stack trace: #0 C:\wamp\www\Smarty\sysplugins\smarty_internal_templatebase.php(345): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #1 C:\wamp\www\myapp\index.php(4): Smarty_Internal_TemplateBase->display('index.tpl') #2 {main} thrown in C:\wamp\www\Smarty\sysplugins\smarty_internal_templatebase.php on line 116
Here's hoping... |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Feb 28, 2012 2:36 pm Post subject: |
|
|
wrong syntax, should be:
Code: | $smarty->setTemplateDir($base_path.'\myapp\smarty\templates');
$smarty->setCompileDir($base_path.'\myapp\smarty\templates_c');
$smarty->setCacheDir($base_path.'\myapp\smarty\cache');
$smarty->setConfigDir($base_path.'\myapp\smarty\configs)'; |
You probably should use forward slashes too, all modern windows systems support forward slash. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|