|
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 |
Gregor Smarty Rookie
Joined: 13 Jul 2003 Posts: 10
|
Posted: Sun Jul 13, 2003 7:08 pm Post subject: need help with this one... |
|
|
index.php
Code: |
// some code here
$moderator_edit = "<a href='edit.php?postid={\$posts[i].id}'>Edit post</a>";
// more code here
$smarty->assign('moderator_edit', $moderator_edit);
$smarty->display('showposts.tpl');
|
showposts.tpl
Code: |
{section name=i loop=$posts}
<!-- here is then some html and smarty code for showing posts, for example: -->
{$posts[i].title}<br /><br />
{$posts[i].text}
<!-- HERE I PUT THAT VARIABLE, CREATED IN PHP FILE -->
{$moderator_edit}
{/section}
|
result, only for that moderator link:
[url=http://p2p.dotproject.org/ed2k/edited2k.php?linkid={$ed2k_links[i].id}]Edit post[/url]
so,.. anyone know, how should i parse or put that link in php file, so smarty could recognize it right?
thanks for ansers! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Sun Jul 13, 2003 9:15 pm Post subject: |
|
|
http://smarty.php.net/manual/en/language.function.eval.php
rofl I posted like seconds after messju _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
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
|