For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > April 2005 > Re: [SMARTY] Re: Including modules









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Re: Including modules
Chris Hubbard

2005-04-15, 4:00 pm

Yes the function function would probably work, but I'd like to
discourage it.

In my opinion a better strategy is to use fetch
(http://smarty.php.net/manual/en/lan...ction.fetch.php)
With fetch you will be maintain a consistent pattern, assign values,
parse the template to get HTML (or php that creates HTML), and then use
display on your page to show everything.

It's not that you want to include top_nav.php. It is that you want to
display the HTML nav elements that are (conditionally) built by
top_nav.php.

Use fetch to get whatever top_nav.php would have displayed (through
echo/print) and stay within the smarty boundaries.

Chris

On Apr 15, 2005, at 10:28 AM, pete M wrote:

> this might do it
> http://smarty.php.net/manual/en/lan...unction.php.php
>
>
>
> Jonathan Villa wrote:
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com