Review main Merged

73260[FEATURE] Introduce unified and flexible templating for TYPO3 Backend

Christian Kuhn CR +2 V +2 Hard +574 −333 updated 02/03/22, 16:35

Commit message

This change introduces new functionality to revamp
the way the core works with views, especially in
backend context to finally achieve a 100% streamlined
templating and rendering concept for Backend output.

The change is based on the following cornerstones:

* ViewInterface (in "core" system extension)
  This is a new generic view interface that can be
  implemented by "view-aware" classes. It is *not*
  bound to fluid anymore, and could be used to connect
  any modern PHP template engine by building adapters.
  The interface brings definitions to add dynamic content
  to a view, plus a method to render the view.

* ResponsableViewInterface (in "core" system extension)
  This interface *can* be added in addition to the newly
  introduced ViewInterface. This is a shortcut interface
  to allow creating a PSR-7 Response object for simple
  cases directly, so controllers do not have
  to deal with ResponseFactory, as the "View" object
  creates the response, and not the controller anymore.

* FluidViewAdapter (in "core" system extension)
  This is a connector between the new ViewInterface
  and the Typo3Fluid implementation.
  This is only a loose connection from core to fluid,
  since that view is never used directly and only retrieved
  using a factory which can be exchanged using DI.

* BackendViewFactory (in "backend" system extension)
  A internal low level factory that returns an instance
  of the newly introduced ViewInterface - in the current
  status a FluidViewAdapter instance.
  On top, it configures default template paths and
  allows overriding them using TSconfig.

* ModuleTemplate
  This already existing class now implements both
  new interfaces ViewInterface and ResponsableInterface.
  This essentially makes the ModuleTemplate the view
  backend controllers can populate. The separation between
  "doc header" from ModuleTemplate and "body" with an
  own view is now obsolete.

The patch simplifies especially the way we deal with
backend module view renderings since ModuleTemplate is
now the view to operate on for actions. The former
ModuleTemplate HTML template is now a *layout*, which can
be used by backend module templates to take care of doc header.

As a bonus feature, layout / template / partial resolving can
be extended using TSconfig, which allows overriding *any* backend
template as soon as all backend views use this strategy.

The patch brings the main interfaces and a first ReST
explaining the feature. Further patches will change
backend views to use this strategy, will deprecate the
old way together with ReST files explaining code further
adaptions and will take care of some loose ends when
further related puzzle pieces fall in place.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 13