![]() |
smarty template testing
Ok,
Newbie question but... I am currently reading throught he smarty templates instruction book and have decided to test a couple of things out. The first excercise is to see if smarty is working properly. so I entered the following into the /customer/main/welcome.tpl: $smarty->assign('name','dion'); <table border="0" cellpadding="2" cellspacing="0"> <tr> <td> Hello, {$name}! </td> </td> </table> Like it says in the book.. then it just displays the assign line and the name line without a name.. what am i doing wrong? cheers. |
try wrap your first tag in {}
|
tried that
it comes up with the error: Fatal error: Smarty: [in customer/main/welcome.tpl line 7]: syntax error: unrecognized tag: $smarty->assign('name','dion'); (Smarty_Compiler.class.php, l in /var/www/html/store/Smarty-2.5.0/Smarty_Compiler.class.php on line 1832 |
i take it you know about http://smarty.php.net
|
yep. i've looked on there.. perhaps it's time to post a question on there...
I just thought someone might have tried it on here... |
aparently,
(I don't know why this didn't occur to me before) but the $smarty->assign('name','dion'); is PHP. Where could i insert the PHP line? does the home.php page exist as i can't find it anywhere? |
you have to imagine that the browser calls a php file which then assigns the smarty variables and then displays them in the smarty templates.
best way to suss it out is to look at one of the simple php pages of xcart and follow the logic through |
got it working.. cheers.
just had to find that pesky home.php file. :D |
All times are GMT -8. The time now is 01:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.