Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Doing a break in a SMARTY {section}

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
ben
Smarty Rookie


Joined: 21 Sep 2004
Posts: 5

PostPosted: Tue Sep 21, 2004 10:10 am    Post subject: Doing a break in a SMARTY {section} Reply with quote

I'd like to do a break (like in PHP) to go out of my SMARTY Section... is irt possible?

Thank a lot ...
Back to top
View user's profile Send private message
ben
Smarty Rookie


Joined: 21 Sep 2004
Posts: 5

PostPosted: Tue Sep 21, 2004 2:03 pm    Post subject: I finaly find a solution Reply with quote

{php}break;{/php}
it seems to work... if someone has an other solution...
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Sep 21, 2004 2:35 pm    Post subject: Reply with quote

I wonder why there have been a spate of these types of questions recently (control and internal pointer access in smarty loops) ?

Your idea may indeed work, but if you resort to that you may be no better off than if you used PHP directly. The idea with Smarty is that most/all data structures required for rendering should be squashed, sliced, diced and otherwise ready for straightforward processing by your template.

If you are going to use this type of technique, you might at least consider putting the code generation into a compiler plugin. That way you can do something like (say) {sectionbreak} which would then insert the appropriate code and perhaps also check the current section stack, etc.
Back to top
View user's profile Send private message
ben
Smarty Rookie


Joined: 21 Sep 2004
Posts: 5

PostPosted: Wed Sep 22, 2004 4:20 pm    Post subject: Thank Reply with quote

Ok I will have a look on it ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP