[TYPO3-mvc] Access typoscript settings in hook
Bas van der Togt
b.vandertogt at profinit.com
Tue Sep 17 12:23:14 CEST 2013
Hello Florian,
Thanks for your reply.
Hoewever it's not working yet.
$objectManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$configurationManager =
$objectManager->get('ConfigurationManagerInterface');
$settings =
$configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
'ff_overview', 'overview');
var_dump($settings);
gives me: #1289386765: Could not analyse class:ConfigurationManager
maybe not loaded or no autoloader?
Regards,
Bas
Op 17-09-13 10:33, Florian schreef:
> 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