Review main Abandoned

72794[WIP][FEATURE] Add agnostic View for Backend modules

Benni Mack CR 0 V 0 Normal +179 −62 updated 02/04/22, 12:14

Commit message

This change introduces a couple of features:

a) A ViewInterface within TYPO3 Core that is not directly
   coupled to Fluid, but compatible with Fluid.
b) A BackendTemplateViewFactory which can be injected to build
   a View object based on a request.
c) Path configuration by one path (Templates) and overridable
   via PageTSconfig.
d) Simplified path configuration, in order to ease the available
options.

"templateRootPaths" are now called "view.templates", and - if not
defined otherwise - partials are placed under
"Resources/Private/Templates/Partials"
and Layouts under Resources/Private/Templates/Layouts/

Ideally, one would then just call

$view = $viewFactory->createFromRequest($request);
$view->render('MyTemplateFile');

and the rest is taken care of by the ViewFactory and the Configuration.

See related Fluid templating engine change: https://github.com/TYPO3/Fluid/pull/581/files

The main benefits of this change:
* Reduce hard-coded paths in Controllers
* Reduce dependencies to Fluid's StandaloneView
* Allow to replace paths via Configuration

Review

  • Code review CR 0
  • Verified V 0

Files 8

Review log 46

  1. Benni Mack uploaded patch set 1 12/22/21, 17:15

  2. core-ci voted on patch set 1 V +1 12/22/21, 17:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21402

  3. Christian Kuhn commented on patch set 1 12/23/21, 09:20

    Routes.php:27 Unresolved

    i'm not entirely convinced binding view paths to routes solves all issues: we have for instance those fluid mails that are sent by controllers which may also render other views - how to deal with those? additionally, this does not give us a chance to have different templates depending on page - for modules that want to for instance may a page 'red' to hint an editor for a 'danger zone' or similar. if we'd bind this to tsconfig instead, we could do both global config (default tsconfig) and per-page config including inheritance ... it would be the sane solution of what extbase currently does with extbase backend modules and typoscript. many modules do tsconfig stuff anyways, so this isn't even parsing overhead.
  4. Benni Mack uploaded patch set 2 01/05/22, 15:27

  5. core-ci voted on patch set 2 V +1 01/05/22, 15:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21651

  6. Christian Kuhn abandoned the change 02/04/22, 12:14

    i think we can safely abandon here: this has been superseded with https://forge.typo3.org/issues/96730