RE: [SMARTY] dealing with links...
| From: | Jeff Dickens | Date: | Wed, 26 Feb 2003 22:15:56 +0000 |
| Subject: | RE: [SMARTY] dealing with links... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8237@lists.php.net to get a copy of this message | ||
See http://news.php.net/article.php?group=php.smarty.general&article=8012
for an idea.
The beauty of this is that you can then refer to {$menu.home.url}, etc in
your templates.
>-----Original Message-----
>From: Ajay Sharma [mailto:ssharma@amntv.com]
>Sent: Wednesday, February 26, 2003 4:57 PM
>To: smarty-general@lists.php.net
>Subject: [SMARTY] dealing with links...
>
>
>This might be kinda dumb, but I've always wondered how other people deal
>with linking to other pages. Do you keep the data in the php script and
>build the link there, or do you assign all the data to variables and
>build the link inside the template?? Here's two examples of what I'm
>talking about:
>
><?php
>$smarty->assign('link',"http://www.blah.com?id=$id&action=$action")
>$smarty->display('index.html')
>?>
>
>Template:
>
><A HREF="{$link}">click here</A>
>
>---OR-----
>
><?php
>$smarty->assign('id',$id)
>$smarty->assign('action',$action)
>$smarty->display('index.html')
>?>
>
>Template:
>
><A
>HREF="http://www.blah.com?id={$id}&action={$action}">click
>here</A>
>
>Thanks... I sometimes mix the two methods as they both have their pros
>and cons. I just wanted to get a feel for what everyone else uses.
>
>Thanks,
>Ajay
>
>
>--
>Smarty General Mailing List (http://smarty.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>