• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 I would like to know if it's the right way to create an import


Formerly Rémi C
here is an example :

public static function importerTest(\XF\SubContainer\Import $container, \XF\Container $parentContainer, array &$importers)
        $importers[] = 'Test:Test';
Could you explain to me what is the purpose of this parameter ?

\XF\SubContainer\Import $container
Thanks you


Formerly Rémi C
That's the right way to add an importer, yes.

It's a sub-container of the root dependency injection container. You could add things to it, or use it to get the import manager if you needed to for whatever reason.
Thank you I'm going to look at her more closely