Forum Moderators: coopster

Message Too Old, No Replies

Using Smarty

Simple test of smarty

         

aijohn

3:06 am on Jul 14, 2005 (gmt 0)

10+ Year Member



I have installed smarty in /home/mysite/usr/smarty

and installed
test1.php in public_html/smarty

<?php
include('/home/mysite/usr/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', 'george smith');
$smarty->assign('address', '45th & Harris');

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

test1.tpl in public_html/smarty/templates

<html>
<head>
<title>User Info</title>
</head>
<body>

User Information:<p>

Name: {$name}<br>
Address: {$address}<br>

</body>
</html>

created directories
smarty/cache
smarty/configs
smarty/templates
smarty/templates_c

When I run this
no error messages
but no output

any suggestions?

aijohn

4:44 am on Jul 14, 2005 (gmt 0)

10+ Year Member



It's working

include('/home/mysite/usr/smarty/libs/Smarty.class.php');

added the libs to the include line

coopster

12:27 pm on Jul 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Glad you got it sorted, aijohn. And welcome to WebmasterWorld.