Tags: TYPO3/Fluid
Tags
[TASK] Adjust interface type hint to match current implementation (#1016 ) Currently, the actual View instance in fact doesn't always return a string for `render()`. We should change this in the future, but for now the interface should represent the actual implementation.
[TASK] Catch errors in schema generation and collect them (#1008) There are cases when errors occur on iterating through the installed view helpers. The generation of the XSDs then break hard with an exception. Currently, this occurs with the TYPO3 extension "schema". Now, these errors are catched and collected. A calling script can get and display these errors. This way, the generation of XSDs is not cancelled, but proceed without the erroneous view helpers. This is especially useful for the TYPO3 command "fluid:schema:generate". Related: #1005
[FEATURE] Respect ContainerInterface in StandardVariableProvider (#1002) With this change, it is possible to access properties of objects implementing `Psr\Container\ContainerInterface` from Fluid templates using the normal object accessor syntax. The interface requires two methods `has()` and `get()` which are used by Fluid to obtain the requested property from the object.
[BUGFIX] Restore previous empty tag attribute behavior (#943) With Fluid 2.12, we introduced the ability to provide arbitrary ViewHelper arguments to TagBasedViewHelpers. Consequently, we deprecated the method registerTagAttribute(), which is no longer necessary due to the mentioned change. However, the implementations differed until now: The previous implementation ignored empty strings for tag attributes, while the new implementation added such input as empty attribute to the resulting tag. We now check for empty strings and null and only add attributes to the tag if it passes those tests. Also, attribute values are converted to string. This patch adds tests to ensure that the behavior is consistent, both for registered and unregistered tag attributes. It also ensures that the inline syntax behaves identically to the tag syntax.
[TASK] Type hint arguments in ViewInterface (#933) Add proper type hints to the two arguments in ViewInterface->assign(). This is not breaking since existing implementations can still accept "more" by not setting these arguments - method arguments of subtypes are contravariant. This will be backported to 2.14.
[TASK] Tune RenderingContext withAttribute() and getAttribute() (#882) getAttribute($className) now always returns an instance of $className, or throws. This avoids checking the returned instance and helps with type hinting in IDEs. withAttribute() now requires a value is an instance of given class name. Checking if an attribute has been set for given class name can be done using hasAttribute() to avoid a try-catch for a generic \RuntimeException. This change is not considered breaking since it is an adjustment of a new API added just recently.
[FEATURE] ViewHelpers to return first/last item of an array (#866) The FirstViewHelper and LastViewHelper return the first or last item of a specified array, respectively. ## Examples ```xml <f:first value="{0: 'first', 1: 'second', 2: 'third'}" /> <!-- Outputs "first" --> <f:last value="{0: 'first', 1: 'second', 2: 'third'}" /> <!-- Outputs "third" --> ```
PreviousNext