Task #8824
Create an abstract base class for Condition ViewHelpers to remove Code Duplication
Status: | Resolved | Start date: | 2010-07-12 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Sebastian Kurfuerst | % Done: | 100% |
|
Category: | - | |||
Target version: | - | |||
Has patch: |
Description
In FLOW3, we already have quite some condition ViewHelpers (f:if, f:security.if*). It turns out they all use a private API inside the framework, as they directly implement the ChildNodeAccessInterface, which is no public API.
Proposed solution
Create a new base class \F3\Fluid\Core\ViewHelper\ConditionViewHelper which should be used as a basis of condition-based ViewHelpers.¶
Breaking change¶
This is a breaking change for people who copied the "if"-ViewHelper and did their own condition evaluation, as the internal workings of the "if"-ViewHelper changed.
How to upgrade¶
Have a look at the new IfViewHelper, and see that it is now far easier to get up and running.
Associated revisions
[!!!][+BUGFIX] Fluid (Core): Refactored all Condition-ViewHelpers like f:if, f:security.if* to use a newly created base class F3\Fluid\Core\ViewHelper\ConditionViewHelper. This greatly simplifies the implementation of custom conditions. However, THIS IS A BREAKING CHANGE in case you copied the f:if ViewHelper to create a custom condition ViewHelper, as the internal workings changed. Please check the new f:if ViewHelper to see how to adjust your ViewHelper -- you basically just have to throw away a lot of code. Resolves #8824.
History
#1 Updated by Sebastian Kurfuerst about 5 years ago
- Status changed from Accepted to Resolved
- % Done changed from 90 to 100
committed in r4836.