Jump to content

Smarty Template Engine Help


Da Foxx

Recommended Posts

I'm pretty new to Smarty, and the reason why I choose it was because it seem like the most easiest to learn without having to actually learn a whole new language. This is what I have:

{foreach from=$forum_posts item=post}
<tr>
<td>
<span class="small">
<b><a href="index.php?profile={$post->author}">{$post->author}</a></b>
<br />
</span>
</td>
<td>{$post->message}</td>
</tr>
{/foreach}

 

This is where my problem is. I need to get {$post->author} and put into a function so that it can take the  name of the author and look for it in another database table and retrive the information, like post count, msn, and etc. How would I do that without having to start mixing my php code with html where it can get ugly.

Link to comment
https://forums.phpfreaks.com/topic/168060-smarty-template-engine-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.