|
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 |
panhead Smarty n00b
Joined: 23 Oct 2003 Posts: 2
|
Posted: Thu Oct 23, 2003 12:26 am Post subject: Newb Install HEEEELLLLLP |
|
|
ok, I'm totally new to smarty. I have followed the basic install directions to a 'T'. Here's what I'm workin with:
XP Pro
Apache 2.0.47
PHP 4.3.3
I've tested the server and PHP. Both are working fine. Now to smarty:
c:\php\includes (all smarty files here)
htdocs\smarty\guestbook - created cache, templates, templates_c, and configs directories under guestbook - index.php and index.tpl also reside here
content of index.php
****
define(’SMARTY_DIR’,’c:\php\includes\’);
require(SMARTY_DIR.’Smarty.class.php’);
$smarty = new Smarty;
$smarty->template_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\templates\’;
$smarty->compile_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\templates_c\’;
$smarty->config_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\configs\’;
$smarty->cache_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\cache\’;
$smarty->assign(’name’,’Ned’);
$smarty->display(’index.tpl’);
contents of index.tpl
****
{* Smarty *}
Hello, {$name}!
Now, when i load index.php into IE6, this is the output I get:
define(’SMARTY_DIR’,’c:\php\includes\’); require(SMARTY_DIR.’Smarty.class.php’); $smarty = new Smarty; $smarty->template_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\templates\’; $smarty->compile_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\templates_c\’; $smarty->config_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\configs\’; $smarty->cache_dir = ’C:\Program Files\Apache Group\Apache2\htdocs\smarty\guestbook\cache\’; $smarty->assign(’name’,’Ned’); $smarty->display(’index.tpl’);
Any ideas where I'm going wrong?
Thanks |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Oct 23, 2003 1:40 am Post subject: |
|
|
your php file needs to be:[php:1:cb89c1ac7e]<?php
// the file contents
?>[/php:1:cb89c1ac7e]
Contents outside of <?php ... ?> tags are ignored by PHP.
HTH |
|
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
|