registerFluidFlexFormTable() public static method

Same as registerFluidFlexFormPlugin, but enables registering FlexForms for any TCA field (type "flex") or field whose TCA you have overridden to display as a FlexForm.
public static registerFluidFlexFormTable ( mixed $table, mixed $fieldName, mixed $templateFilename, mixed $variables = [], $section = NULL, $paths = NULL ) : void
$table mixed The SQL table this FlexForm is bound to
$fieldName mixed The SQL field this FlexForm is bound to
$templateFilename mixed Location of the Fluid template containing field definitions
$variables mixed Optional array of variables to pass to Fluid template
return void
Exemplo n.º 1
0
 /**
  * @test
  */
 public function canRegisterStandaloneTemplateForTable()
 {
     $service = $this->createFluxServiceInstance();
     $variables = array('test' => 'test');
     $paths = array('templateRootPath' => 'EXT:flux/Resources/Private/Templates');
     $table = 'fake';
     $fieldName = NULL;
     $providerClassName = 'FluidTYPO3\\Flux\\Provider\\ProviderInterface';
     $relativeTemplatePathAndFilename = self::FIXTURE_TEMPLATE_ABSOLUTELYMINIMAL;
     $record = Records::$contentRecordWithoutParentAndWithoutChildren;
     $absoluteTemplatePathAndFilename = GeneralUtility::getFileAbsFileName($relativeTemplatePathAndFilename);
     $configurationSectionName = 'Configuration';
     Core::registerFluidFlexFormTable($table, $fieldName, $relativeTemplatePathAndFilename, $variables, $configurationSectionName, $paths);
     $detectedProvider = $service->resolvePrimaryConfigurationProvider($table, $fieldName, $record);
     $this->assertInstanceOf($providerClassName, $detectedProvider);
     $this->assertSame($absoluteTemplatePathAndFilename, $detectedProvider->getTemplatePathAndFilename($record));
     $this->assertSame(PathUtility::translatePath($paths), $detectedProvider->getTemplatePaths($record));
 }