Project

General

Profile

Feature #77275

Updated by Markus Klein almost 8 years ago

I think it would be good to have an inverse version of the IfViewHelper. 

 For me the following workaround is not very pretty: 
 <pre> 
     

     <f:if condition="{condition}"> 
         <f:then> </f:then> 
         <f:else>This is the important part</f:else> 
     </f:if> 
 </pre> 

 My suggestion is to introduce the UnlessViewHelper, like in [Handlebars](http://handlebarsjs.com/builtin_helpers.html#unless) 

 <pre> 
     

     <f:unless condition="{hopeFullyFalse}"> 
         Alright, the variable is false 
     </f:unless> 

     <f:unless condition="{hopeFullyFalse}"> 
         <f:then>Alright, the variable is false</f:then> 
         <f:else>Sorry the variable is true</f:else> 
     </f:unless> 
 </pre> 

 


 PS: Sorry if this is a duplicate

Back