[TYPO3-mvc] Condition in if-ViewHelper quesion

Thomas Hempel thomas at typo3-unleashed.net
Wed Aug 25 07:25:00 CEST 2010


Hi,

>
> Have a look at Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode.
Thanks. Found it. :-)

>
>>
>> The background for this question is that I pass a negative value to a
>> variable and check that in an condition.
>
> Wow, I thought the built-in was at least able to treat numbers - but
> obvoiusly it is not (see the regexp member variable of the class).
> What I would recommend is writing a ViewHelper that returns true or
> false and use it with the inline notation as condition. That should work
> until fluid is updated.
I solved it differently.

I just set the variable to NULL and removed the comparator.

Now it looks like this:

Controller:
$this->view->assign('value', NULL);

Template:
<f:if condition="{value}">
...


That works too in my case.


Greets,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list