Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
a function like {disabled} to disable code parts

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
ndorphin
Smarty Rookie


Joined: 24 Dec 2009
Posts: 12
Location: Berlin, Germany

PostPosted: Wed Jul 20, 2011 4:56 am    Post subject: a function like {disabled} to disable code parts Reply with quote

Yes, i know that i can use an if block to prevent some code'll be executed but i think for maintenance it will be better to have a fixed function. In larger project it's posssible that you forget where you setted a "disable" if block and maybe it brings a bit performance if the {disabled} parts can be removed from compiled templates, cache files etc.

How do you think about it?

ndorphin!
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4625
Location: Hamburg / Germany

PostPosted: Wed Jul 20, 2011 5:27 am    Post subject: Reply with quote

You could easily implement a prefilter to remove {disable}...{/disbale} code blocks.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Wed Jul 20, 2011 6:55 am    Post subject: Reply with quote

Code:
{* disabled
how about using comments?
*}
Back to top
View user's profile Send private message Visit poster's website
ndorphin
Smarty Rookie


Joined: 24 Dec 2009
Posts: 12
Location: Berlin, Germany

PostPosted: Thu Jul 21, 2011 1:15 am    Post subject: Reply with quote

globe wrote:
Code:
{* disabled
how about using comments?
*}

Ah, thanks - didn't know that this is possible and removes the code from templates etc.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests 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