Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smart exit

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
cjxxi
Smarty Regular


Joined: 03 Aug 2007
Posts: 40
Location: Fort Worth,Texas

PostPosted: Tue Jan 15, 2008 5:13 am    Post subject: Smart exit Reply with quote

how would do something inside the template that would exit the template but not the php script... just like php built-in function exit() or die(); without using an if, else statement? and only exit the template not the php code.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jan 15, 2008 8:21 am    Post subject: Reply with quote

A compiler plugin that emits a php return-statement should do it.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
floppydrivez
Smarty Rookie


Joined: 31 Mar 2008
Posts: 14

PostPosted: Sun Jun 20, 2010 4:17 am    Post subject: Reply with quote

This would be a great feature, sorry to dredge up the past.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sun Jun 20, 2010 2:00 pm    Post subject: Reply with quote

This would only encourage poorly formed templates. There should be no reason to "exit" a template. Use an IF statement around the logic you do not want to execute. If you start exiting templates, you just create more situations that are harder to debug.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons 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