How to implement Connector Services (svconnector) in TYPO3 12?

18 Views Asked by At

I try to to implement Connector Service (svconnector) in an extension in TYPO3 12 to show the content of a CSV with FLUID.

Following the manual I created the following class:

Classes/Services/Publications.php

namespace Vendor\Publications\Service;

abstract class Publications extends \Cobweb\Svconnector\Service\ConnectorBase
{

}

I also added the following to register the service:

Configuration/Services.yaml

...
  Cobweb\SvconnectorCsv\Service\ConnectorCsv:
    public: true
    arguments:
      - !tagged_iterator connector.service

Now I would like to connect to a CSV-file using the following code in my Class (see here in the manual):

$registry = GeneralUtility::makeInstance(\Cobweb\Svconnector\Registry\ConnectorRegistry::class);
$connector = $registry->getServiceForType('csv');

I do not understand where to place this code to register the class and implement the service.

In TYPO3 11 the connection code was implemented in the following file but it does not work in TYPO3 12.

Classes/Controller/PublicationsController.php

I really appreciate your help.

0

There are 0 best solutions below