[TYPO3-mvc] Access typoscript settings in hook
Bas van der Togt
b.vandertogt at profinit.com
Tue Sep 17 12:51:20 CEST 2013
Thanks. No errors anymore. But i get NULL back.
$objectManager =
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$configurationManager =
$objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
$settings =
$configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
'ff_overview');
var_dump($settings);
Any idea?
Op 17-09-13 12:30, Florian schreef:
> Try with the namespace :
> $configurationManager =
> $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
>
>
> Florian
>
> Le 17/09/2013 12:23, Bas van der Togt a écrit :
>> 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
>>>>
>>>
>>
>> _______________________________________________
>> 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