Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31368

As a Developer I want to tag my view builders

    XMLWordPrintable

    Details

    • Story Points:
      2

      Description

      View builder is a service which is used to build instances of Views (\eZ\Publish\Core\MVC\Symfony\View\View) to be able to e.g. pass ContentView to a controller as its parameter.

      There's a registry which gets a specific ViewBuilder for a given Controller, however right now to be able to add a Builder to that registry, a custom compiler pass is required, as it's done so for AdminUI, SupportTools, User Bundle, or RepositoryForms.

      This should not be so complicated (and so WET BTW.).

      What is needed is a simple DI, so our and 3rd party View Builders can be tagged using ezplatform.spi.view_builder tag.
      E.g.:

      EzSystems\EzPlatformAdminUi\View\Builder\ContentTranslateViewBuilder: 
          tags: 
              - { name: ezplatform.spi.view_builder }
      

      It's so simple it can be even registered for auto-configuration, so it's enough to just register a service implementing \eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilder with autowire: true attribute.

        Attachments

          Activity

            People

            Assignee:
            andrzej.longosz@ez.no Andrzej Longosz
            Reporter:
            andrzej.longosz@ez.no Andrzej Longosz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: