You are here: Re: [SMARTY] Re: Including modules « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Re: Including modules

Posted by Chris Hubbard on 09/30/40 11:14

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/language.function.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/language.function.php.php
>
>
>
> Jonathan Villa wrote:
>> I've been trying to figure this out...
>> I have header.tpl and footer.tpl
>> Within header.tpl I want to include 3 pages of logic
>> top_nav.php
>> left_nav.php
>> right_nav.php
>> I looked at include_php but read it was deprecated... and I read a
>> little about the
>> cond.. templates but that didn't work out for me... when I ran it, I
>> would an error
>> on using my $smarty instantiation... reason being, I'm not
>> instantiating smarty on
>> the actual page but that another page which get's prepended...
>> Any ideas on how to include the top without using {php}
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация