[TYPO3-mvc] Access typoscript settings in hook
Federico Bernardin
typo3list at bernardin.it
Thu Sep 19 11:30:51 CEST 2013
Hi Bas,
it could be a problem when your hook is called, if it uses makeInstance to call your hook, dependency injection will be used, but if the object is created in another way dependency injection will not be called.
Hi
Federico
Il giorno 16/set/2013, alle ore 15:24, Bas van der Togt <b.vandertogt at profinit.com> ha scritto:
> Hello,
>
> How can i access the typoscript settings in a hook?
>
> \Classes\Hook\ItemsProcFunc.php
> --
> namespace Pro\FfOverview\Hook;
> class ItemsProcFunc {
>
> /**
> * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
> * @inject
> */
> protected $configurationManager;
>
> public function addFields($config) {
> $settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'ff_overview', 'overview');
> [...]
> }
> }
> --
>
> With above code i get: Fatal error: Call to a member function getConfiguration() on a non-object...
>
> Regards,
> Bas
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list