Re: nested templates (sic)

From: Date: Fri, 21 Dec 2001 01:30:52 +0000
Subject: Re: nested templates (sic)
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2353@lists.php.net to get a copy of this message
It only includes the other template if the conditional is true. Otherwise, it stops including (therefore not resulting in an infinite loop). If you have 6 levels of tables, you'll have to think how you want to pass them in. You would probably have a multi-dimensional array that you set up with data from a database or a file or whatever. You could also try that smarty table class that has been talked about on this list (I think there's a search?). Brian ----- Original Message ----- From: "Francois Dumais" <f_dumais@videotron.ca> To: smarty@lists.ispi.net Date: 12/20/01 7:12:38 PM > >Sorry ... I think I am going to flip burgers .... > >isn't the snippet a little recursive? and how do you use this mechanism? I >don't get it. > >----- Original Message ----- >From: "Brian E. Lozier" <brian@massassi.net> >To: <smarty@lists.ispi.net> >Sent: Thursday, December 20, 2001 4:08 PM >Subject: [smarty] Re: nested templates (sic) > > >> You just have to have an escape route. >> >> blah.tpl: >> {if $Table} >> {include file="blah.tpl"} >> {else} >> No more tables! >> {/if} >> >> >> ----- Original Message ----- >> From: "Francois Dumais" <f_dumais@videotron.ca> >> To: smarty@lists.ispi.net >> Date: 12/20/01 6:59:39 PM >> >> > >> >Thanks for your promptitude, your answer relaxed me. >> > >> >Is this to mean that reusable templates are not an option when you run >the >> >risk of calling a template that embeds at any level further this very >> >template? >> > >> >Does the solution lie in the creation of reusable "instances" of tables >> >(renamed copies of the template) in order to attain ...generic... >> >embedment?? Or is there a better way to do this?? >> > >> > >> >----- Original Message ----- >> >From: "Monte Ohrt" <monte@ispi.net> >> >To: <smarty@lists.ispi.net> >> >Cc: <smarty@lists.ispi.net> >> >Sent: Thursday, December 20, 2001 3:22 PM >> >Subject: [smarty] Re: nested templates (sic) >> > >> > >> >> use include to recursively include templates within another. >> >> >> >> {include file="foo.tpl"} >> >> >> >> And obviously, you can get stuck in an infinite loop if a template >> >> includes itself. >> >> >> >> > Francois Dumais wrote: >> >> > >> >> > I am new to smarty. I would just like to know what is the basic >> >> > technique or mechanism needed in smarty to have embedded (or nested) >> >> > templates. Practically speaking I want to have html tables within >> >> > html tables. I have tried to include templates that include >templates >> >> > that include templates, each template being basically built as an >html >> >> > wrapper around the include call. But it doesn't work. Any hints >> >> > would be appreciated. Should we use "fetch", "capture", >> >> > or >> >> > "sections"? >> >> > --- >> >> > You are currently subscribed to smarty as: monte@ispi.net >> >> > To unsubscribe send a blank email to >> >> > $subst('Email.Unsub') >> >> > Visit Smarty's homepage at >> >> > http://www.phpinsider.com/php/code/Smarty/ >> >> >> >> -- >> >> Monte Ohrt <monte@ispi.net> >> >> http://www.ispi.net/ >> >> >> >> --- >> >> You are currently subscribed to smarty as: f_dumais@videotron.ca >> >> To unsubscribe send a blank email to >$subst('Email.Unsub') >> >> Visit Smarty's homepage at >> >> http://www.phpinsider.com/php/code/Smarty/ >> > >> > >> >--- >> >You are currently subscribed to smarty as: brian@massassi.net >> >To unsubscribe send a blank email to $subst('Email.Unsub') >> >Visit Smarty's homepage at Ÿ >> >cL¡«w:ÜJ¯u^>‹http://www.phpinsider.com/php/code/Smarty/ >> >> >> --- >> You are currently subscribed to smarty as: f_dumais@videotron.ca >> To unsubscribe send a blank email to $subst('Email.Unsub') >> Visit Smarty's homepage at >> http://www.phpinsider.com/php/code/Smarty/ > > >--- >You are currently subscribed to smarty as: brian@massassi.net >To unsubscribe send a blank email to $subst('Email.Unsub') >Visit Smarty's homepage at >http://www.phpinsider.com/php/code/Smarty/

« previous php.smarty.general (#2353) next »