Re: [SMARTY-DEV] Re: Is this plugin useful?

From: Date: Wed, 09 Apr 2003 16:05:50 +0000
Subject: Re: [SMARTY-DEV] Re: Is this plugin useful?
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1119@lists.php.net to get a copy of this message
On Wed, Apr 09, 2003 at 12:36:33PM -0300, luis wrote: > Yap bu think about a install script > > {if nodatabase} > form asking for host... etc > {else} > {if no admin account} > form asking for admin account > {else} > {if upgrading} > .... > {else} > .... > {/if} > {/if} > {/if} > > I guess is more readable the form: > > {if nodatabase} > blah > {stop} > {/if} > > {if no admin acc} > blah > {stop} > {/if} > > {if upgrading} > {stop} > {/if} hmm i wouldn't put that logic inside the template. why not: index.php: $form = 'done'; if (!$upgrading) $form = 'upgrading'; if (!$admin_account) $form = 'admin_account'; if (!$database) $form = 'database'; $smarty->assign('form', $form.'.tpl'); $smarty->display('index.tpl'); index.tpl: ... {include file=$form} ... ?? > -----Original Message----- > From: Joscha Feth [mailto:joscha@feth.com] > Sent: Wednesday, April 09, 2003 11:22 AM > To: smarty-dev@lists.php.net > Subject: [SMARTY-DEV] Re: Is this plugin useful? > > Luis wrote: > Hi, > > I wonder if a plugin to stop displaying a template may added to the > > smarty distro, > > Something like {stop [msg='foo']} that will be compiled into a > > die('foo'); statement. > > In some situations templates will be more readable if you can stop > > displaying rather than using a bunch of {if}s > > I do not think it is useful, because some HTML Tags may not be closed > and > always just sending a </body></html> is no good coding style, but > whatever, > I created such a plugin especially (really!) for you: > http://dev.feth.com/PHP/Smarty/function.die.phps > > greets, > Joscha > > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Linux: Das Windows98 unter den Unixen. Heiko Schlichting

« previous php.smarty.dev (#1119) next »