RE: [SMARTY-DEV] Re: Is this plugin useful?
| From: | luis | Date: | Wed, 09 Apr 2003 16:31:04 +0000 |
| Subject: | RE: [SMARTY-DEV] Re: Is this plugin useful? | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1122@lists.php.net to get a copy of this message | ||
It's the installation script no need to use includes and it can have
some logic...
Anyway since it's a very particular usage maybe we don't need it.
-----Original Message-----
From: Monte Ohrt [mailto:monte@ispi.net]
Sent: Wednesday, April 09, 2003 1:20 PM
To: luis
Cc: 'Joscha Feth'; Smarty Dev
Subject: RE: [SMARTY-DEV] Re: Is this plugin useful?
You are trying to use smarty for your business logic and presentation,
that will usually get you a tangled mess and defeat the purpose of using
templates. The logic in the templates should be for presentation only.
php psuedo-code:
if( no database ) {
... business logic ...
$smarty->assign(...);
$smarty->display('no_db_form.tpl');
} else {
if( no admin account ) {
... business logic ...
$smarty->assign(...);
$smarty->display('admin_acct_form.tpl');
} else {
...
}
}
On Wed, 2003-04-09 at 10:36, 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}
>
>
> -----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
--
Monte Ohrt <monte@ispi.net>