[TriLUG] Smarty

Michael Kimsal mgkimsal at gmail.com
Thu Sep 19 15:21:31 EDT 2013


Thank Scott - good to know!


On Thu, Sep 19, 2013 at 1:48 PM, Scott Lambdin <lopaki at gmail.com> wrote:

> I was going to say about the same thing Michael said.  Looks like Smarty 3
> added "break"
>
>
> On Thu, Sep 19, 2013 at 1:41 PM, Michael Kimsal <mgkimsal at gmail.com>
> wrote:
>
> > You'd likely need to create some other placeholder value that is checked
> > inside your iteration loop, and only process if the value is set to
> > something specific.  When a condition is met, change the placeholder
> value.
> >  The iteration will continue but skip over the actual logic.
> >
> > Yeah, you could modify the DB call in this case, but being able to break
> > out of loops in general is a useful pattern, but AFAIK smarty doesn't
> > support it.  Groovy (java) doesn't either in its "each" iteration, which
> > bugs me.  :/
> >
> >
> >
> > On Thu, Sep 19, 2013 at 11:45 AM, Brian McCullough <bdmc at buadh-brath.com
> > >wrote:
> >
> > > Drawing once again on the deep well of knowledge here, I have a
> question
> > > about Smarty.
> > >
> > > If there a "break" ( exit early ) statement in the "foreach" block in
> > > Smarty 2?
> > >
> > > I have been reading the documentation and I don't seem to see that kind
> > > of functionality.
> > >
> > >
> > > Basically, I have a database read providing the array of data being
> > > displayed, but I want to stop displaying after a certain number of
> > > items, rather than blindly displaying everything, no matter what.
> > >
> > >
> > > Thanks,
> > > Brian
> > >
> > >
> > > --
> > > This message was sent to: mgkimsal at gmail.com <mgkimsal at gmail.com>
> > > To unsubscribe, send a blank message to trilug-leave at trilug.org from
> > that
> > > address.
> > > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > > Unsubscribe or edit options on the web  :
> > > http://www.trilug.org/mailman/options/trilug/mgkimsal%40gmail.com
> > > Welcome to TriLUG: http://trilug.org/welcome
> > >
> >
> >
> >
> > --
> > Michael Kimsal
> > http://michaelkimsal.com
> > 919.827.4724
> > --
> > This message was sent to: Scott Lambdin <lopaki at gmail.com>
> > To unsubscribe, send a blank message to trilug-leave at trilug.org from
> that
> > address.
> > TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> > Unsubscribe or edit options on the web  :
> > http://www.trilug.org/mailman/options/trilug/lopaki%40gmail.com
> > Welcome to TriLUG: http://trilug.org/welcome
> >
> --
> This message was sent to: mgkimsal at gmail.com <mgkimsal at gmail.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> http://www.trilug.org/mailman/options/trilug/mgkimsal%40gmail.com
> Welcome to TriLUG: http://trilug.org/welcome
>



-- 
Michael Kimsal
http://michaelkimsal.com
919.827.4724


More information about the TriLUG mailing list