Skip to content
Snippets Groups Projects
Commit 9a436c71 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix extendedIf ViewHelper

parent 90f557c6
No related branches found
No related tags found
No related merge requests found
......@@ -33,35 +33,44 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
*/
class ExtendedIfViewHelper extends AbstractConditionViewHelper {
/**
* @return void
* Initializes the "then" and "else" arguments
*/
public function initializeArguments() {
$this->registerArgument('condition', 'boolean', 'Condition to be evaluated.');
$this->registerArgument('or', 'boolean', 'First or condition');
$this->registerArgument('or2', 'boolean', 'Second or condition');
$this->registerArgument('or3', 'boolean', 'Third or condition');
$this->registerArgument('or4', 'boolean', 'Fourth or condition');
$this->registerArgument('and', 'boolean', 'First and condition');
$this->registerArgument('and2', 'boolean', 'Second and condition');
$this->registerArgument('and3', 'boolean', 'Third and condition');
$this->registerArgument('and4', 'boolean', 'Fourth and condition');
$this->registerArgument('negate', 'boolean', 'Negate complete condition');
parent::initializeArguments();
$this->registerArgument(
'condition', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
$this->registerArgument(
'or', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
$this->registerArgument(
'or2', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
$this->registerArgument(
'or3', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
$this->registerArgument(
'or4', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
$this->registerArgument(
'and', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, TRUE
);
$this->registerArgument(
'and2', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, TRUE
);
$this->registerArgument(
'and3', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, TRUE
);
$this->registerArgument(
'and4', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, TRUE
);
$this->registerArgument(
'negate', 'boolean', 'Condition expression conforming to Fluid boolean rules', FALSE, FALSE
);
}
/**
* renders <f:then> child if $condition or $or is true, otherwise renders <f:else> child.
*
* Note: The phpdoc data type of the parameter must be named "boolean".
* Otherwise Fluid doesn't evaluates conditions itself.
*
* @return string
*/
public function render() {
return parent::render();
}
/**
* This method decides if the condition is TRUE or FALSE. It can be overridden in extending viewhelpers to adjust functionality.
* This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality.
*
* @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method.
* @return bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment