Same as registerFluidFlexFormPlugin, but uses a content object type for
resolution - use this if you registered your Extbase plugin as a content
object in your localconf.
public static registerFluidFlexFormContentObject ( mixed $extensionKey, mixed $contentObjectType, mixed $templateFilename, mixed $variables = [], $section = NULL, $paths = NULL, string $fieldName = 'pi_flexform' ) : void | ||
$extensionKey | mixed | The extension key which registered this FlexForm |
$contentObjectType | mixed | The cType of the object you registered |
$templateFilename | mixed | Location of the Fluid template containing field definitions |
$variables | mixed | Optional array of variables to pass to Fluid template |
$fieldName | string | Optional fieldname if not from pi_flexform |
return | void |
/** * @test */ public function canRegisterStandaloneTemplateForContentObject() { $service = $this->createFluxServiceInstance(); $variables = array('test' => 'test'); $paths = array('templateRootPath' => 'EXT:flux/Resources/Private/Templates'); $extensionKey = 'fake'; $contentObjectType = 'void'; $providerClassName = 'FluidTYPO3\\Flux\\Provider\\ProviderInterface'; $relativeTemplatePathAndFilename = self::FIXTURE_TEMPLATE_ABSOLUTELYMINIMAL; $record = Records::$contentRecordWithoutParentAndWithoutChildren; $record['CType'] = $contentObjectType; $absoluteTemplatePathAndFilename = GeneralUtility::getFileAbsFileName($relativeTemplatePathAndFilename); $configurationSectionName = 'Configuration'; Core::registerFluidFlexFormContentObject($extensionKey, $contentObjectType, $relativeTemplatePathAndFilename, $variables, $configurationSectionName, $paths); $detectedProvider = $service->resolvePrimaryConfigurationProvider('tt_content', NULL, $record, $extensionKey); $this->assertInstanceOf($providerClassName, $detectedProvider); $this->assertSame($extensionKey, $detectedProvider->getExtensionKey($record)); $this->assertSame($absoluteTemplatePathAndFilename, $detectedProvider->getTemplatePathAndFilename($record)); $this->assertSame(PathUtility::translatePath($paths), $detectedProvider->getTemplatePaths($record)); }
/** * @test */ public function canRegisterStandaloneTemplateForContentObject() { $service = $this->createFluxServiceInstance(); $variables = array('test' => 'test'); $paths = array('templateRootPaths' => array('EXT:flux/Resources/Private/Templates')); $extensionKey = 'fake'; $contentObjectType = 'void'; $providerClassName = 'FluidTYPO3\\Flux\\Provider\\ProviderInterface'; $relativeTemplatePathAndFilename = self::FIXTURE_TEMPLATE_ABSOLUTELYMINIMAL; $record = Records::$contentRecordWithoutParentAndWithoutChildren; $record['CType'] = $contentObjectType; $absoluteTemplatePathAndFilename = GeneralUtility::getFileAbsFileName($relativeTemplatePathAndFilename); $configurationSectionName = 'Configuration'; $result = Core::registerFluidFlexFormContentObject($extensionKey, $contentObjectType, $relativeTemplatePathAndFilename, $variables, $configurationSectionName, $paths); $this->assertNull($result); }