|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ndorphin Smarty Rookie
Joined: 24 Dec 2009 Posts: 15 Location: Berlin, Germany
|
Posted: Wed Jul 20, 2011 4:56 am Post subject: a function like {disabled} to disable code parts |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jul 20, 2011 5:27 am Post subject: |
|
|
You could easily implement a prefilter to remove {disable}...{/disbale} code blocks. |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Wed Jul 20, 2011 6:55 am Post subject: |
|
|
Code: | {* disabled
how about using comments?
*} |
|
|
Back to top |
|
ndorphin Smarty Rookie
Joined: 24 Dec 2009 Posts: 15 Location: Berlin, Germany
|
Posted: Thu Jul 21, 2011 1:15 am Post subject: |
|
|
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 |
|
|
|
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
|