Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Novices question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
wantho
Smarty Rookie


Joined: 21 Sep 2011
Posts: 8

PostPosted: Tue Feb 28, 2012 11:14 am    Post subject: Novices question Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 28, 2012 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP