Re: [SMARTY-DEV] Block extensibility?

From: Date: Wed, 26 Mar 2003 11:43:06 +0000
Subject: Re: [SMARTY-DEV] Block extensibility?
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1028@lists.php.net to get a copy of this message
> > i don't know which one you mean, but i'm pretty sure it is not anyway. > > > In this case, can I write blocks such as the following one? > > {if} > > {elsif}* repeated an unlimited (and not know a-priori) number of times > > {else} > > {/if} > > blocks in smarty a very restricted. for something like the above you > would have to use your own compiler functions. see: > http://smarty.php.net/manual/en/plugins.compiler.functions.php > > (hint) maybe you don't need to patch smarty, since you can: > register_compiler_function('myif', 'myif_open); > register_compiler_function('/myif', 'myif_close); > > then you can implement a closing and an opening function (and > optionallyy my_else etc., of course) and write in your template: > {myif ...} ... {/myif} > And in this case how can I instruct Smarty that {myelse} is part of {myif} {/myif} syntactic block ? Thanks.

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