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

 
Post new topic   Reply to topic    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: 3335
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: 7238
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:   
Post new topic   Reply to topic    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