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

constant parse errors - fixed

 
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
x-wing
Smarty n00b


Joined: 27 Mar 2004
Posts: 1

PostPosted: Sat Mar 27, 2004 11:39 pm    Post subject: constant parse errors - fixed Reply with quote

Ok, i'm using Gentoo with Apache 2.

I installed smarty and tried to run a test application:

file testing.php:
Code:

<?php

include('/usr/lib/php/Smarty/Smarty.class.php')

//create object
$smarty = new Smarty;

//assign some content. This would typically come from a database or other source,
//but we'll use static values for the purpose of this example.

$smarty->assign('name', 'Gregory Smith');
$smarty->assign('address','45th and harris');

//display it
$smarty->display('testing.tpl');
?>


file testing.tpl
Code:

<html>
<head>
<title>Template - Using Smarty; test</title>
</head>
<body>
<br>

User information:<p>

Name: {$name}<br>
Address: {$address}<br>
Date: {$smarty.now}<br>

</body>
</html>


the error I get is:
Parse error: parse error in /var/www/localhost/htdocs/testing.php on line 6, which is the following line:
Code:

$smarty = new Smarty;


What is wrong with that path? Its pretty much copy-pasted from the tutorial. Also, what are these template directories? I dont' see them on my system. Where should I create them? What should be the hierarchy? I know these are a lot of questions, but i'd appreciate anyone willing to help out.

TIA
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sun Mar 28, 2004 5:30 am    Post subject: Reply with quote

Check your code around line 6 more closely:

include('/usr/lib/php/Smarty/Smarty.class.php') ;

I hate to say it, but if you don't know what a template directory is, you haven't read enough to be asking questions yet Smile
Back to top
View user's profile Send private message
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