Project

General

Profile

Actions

Bug #101559

closed

Extbase view should not require renderSection and renderPartial

Added by Hannes Lau over 1 year ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2023-08-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Currently, extbase view resolvers must return fluid views. Fluid views need to implement `renderSection` and `renderPartial`. Those methods do not make sense for many views, such as json or xml views. The methods should not be required for all extbase views.

More technically, the return type of `\TYPO3\CMS\Extbase\Mvc\View\ViewResolverInterface::resolve` is `\TYPO3Fluid\Fluid\View\ViewInterface`.

`\TYPO3Fluid\Fluid\View\ViewInterface`:


    public function renderSection($sectionName, array $variables = [], $ignoreUnknown = false);

    public function renderPartial($partialName, $sectionName, array $variables, $ignoreUnknown = false);

```

Even the `\TYPO3\CMS\Extbase\Mvc\View\JsonView` is affected by this.

    public function renderSection($sectionName, array $variables = [], $ignoreUnknown = false)
    {
        // No-op: renderSection does not make sense for this view
        return '';
    }

    public function renderPartial($partialName, $sectionName, array $variables, $ignoreUnknown = false)
    {
        // No-op: renderPartial does not make sense for this view
        return '';
    }
Suggestion: Use an Extbase specific view interface which only requires the following methods:
  • assign
  • assignMultiple
  • render

Alternatively, use the `\TYPO3\CMS\Core\View\ViewInterface` instead.


Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Feature #96730: Revamp backend templating strategyClosed2022-02-02

Actions
Related to TYPO3 Core - Task #104463: Raise typo3fluid/fluid:^2.14.0Closed2024-07-23

Actions
Related to TYPO3 Core - Task #104709: Avoid FluidViewAdapter as inner viewClosed2024-08-22

Actions
Related to TYPO3 Core - Feature #104773: Implement and use a core ViewFactoryInterfaceClosed2024-08-29

Actions
Related to TYPO3 Core - Task #105437: Remove deprecated methods from FluidViewAdapterResolved2024-10-24

Actions
Actions

Also available in: Atom PDF