Reputation: 379
The way to add a DataProcessor to a PAGE or a FLUIDTEMPLATE is often shown. How can it be assigned to a TYPO3 plugin?
For a PAGE you can do it like this:
page {
10 {
dataProcessing {
1558428437 = BK2K\BootstrapPackage\DataProcessing\ConstantsProcessor
1558428437 {
as = myconstants
key = settings.constants
}
}
}
}
But can you do something like this:
config.tx_extbase {
dataProcessing {
1558428437 = BK2K\BootstrapPackage\DataProcessing\ConstantsProcessor
1558428437 {
as = myconstants
key = settings.constants
}
}
Many thanks!
Upvotes: 2
Views: 1950
Reputation: 6480
No, this is not possible since data processors is a feature of the FLUIDTEMPLATE
content object alone.
In this case you can invoke the ConstantsProcessor
manually in your controller action. You can get the current ContentObjectRenderer
via $this->configurationManager->getContentObject()
. The $processorConfiguration
is the same as in TypoScript but as array:
$constantsProcessor = GeneralUtility::makeInstance(ConstantsProcessor::class);
$data = $constantsProcessor->process(
$this->configurationManager->getContentObject(),
[],
[
'key' => 'settings.constants',
'as' => 'myconstants',
],
[]
);
// Use $data['myconstants']
Upvotes: 7
Reputation: 1095
That's currently not possible.
This would definitely be a feature that would make live of Integrators much easier.
Upvotes: 4