registerFluidFlexFormPlugin() public static method

Note: you can point to your Model Object templates and place the configuration in these templates - and get automatically transformed values from your FlexForms, i.e. a Domain Object instance from a "group" type select box or an ObjectStorage from a list of records. Usual output is completely ignored, only the "Configuration" section is considered.
public static registerFluidFlexFormPlugin ( mixed $extensionKey, mixed $pluginSignature, mixed $templateFilename, mixed $variables = [], $section = NULL, $paths = NULL, string $fieldName = 'pi_flexform' ) : void
$extensionKey mixed The extension key which registered this FlexForm
$pluginSignature mixed The plugin signature this FlexForm belongs to
$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
Example #1
0
 /**
  * @test
  */
 public function canRegisterStandaloneTemplateForPlugin()
 {
     $service = $this->createFluxServiceInstance();
     $variables = array('test' => 'test');
     $paths = array('templateRootPath' => 'EXT:flux/Resources/Private/Templates');
     $extensionKey = 'more_fake';
     $pluginType = 'void';
     $fieldName = NULL;
     $providerClassName = 'FluidTYPO3\\Flux\\Provider\\ProviderInterface';
     $relativeTemplatePathAndFilename = self::FIXTURE_TEMPLATE_ABSOLUTELYMINIMAL;
     $record = Records::$contentRecordWithoutParentAndWithoutChildren;
     $record['list_type'] = $pluginType;
     $absoluteTemplatePathAndFilename = GeneralUtility::getFileAbsFileName($relativeTemplatePathAndFilename);
     $configurationSectionName = 'Configuration';
     Core::registerFluidFlexFormPlugin($extensionKey, $pluginType, $relativeTemplatePathAndFilename, $variables, $configurationSectionName, $paths);
     $detectedProvider = $service->resolvePrimaryConfigurationProvider('tt_content', $fieldName, $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));
 }