[TYPO3-mvc] Access typoscript settings in hook
Florian
florian.typo3 at oktopuce.fr
Tue Sep 17 10:33:56 CEST 2013
Hi,
The message tells you that your object configurationManager is
undefined, you'd better do something like this :
$objectManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('ObjectManager');
$configurationManager =
$objectManager->get('ConfigurationManagerInterface');
$configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
'ff_overview', 'overview');
Regards,
Florian RIVAL
tél.: 06.42.25.54.48
web: www.oktopuce.fr <http://www.oktopuce.fr/>
skype: florian-rival
Okto'puce - Services informatiques
Afin de contribuer au respect de l'environnement, merci de n'imprimer
cet e-mail que si nécessaire.
Le 16/09/2013 15:24, Bas van der Togt a écrit :
> 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