Last active
September 27, 2019 14:04
-
-
Save fchaussin/c20ca4b77003a382587d523399ae72b2 to your computer and use it in GitHub Desktop.
TYPO3 : adding a FlexForm to an Extbase Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('TYPO3_MODE') || die('Access denied.'); | |
call_user_func( | |
function() | |
{ | |
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(... | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(... | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(.... | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages(... | |
} | |
); | |
//////////////////////////////////////////////////////////////////////////////////////////////// | |
$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY); | |
$pluginSignature = strtolower($extensionName) . '_my_plugin_namet'; | |
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY.'/Configuration/FlexForms/my_plugin_name.xml'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<T3DataStructure> | |
<sheets> | |
<page1> | |
<ROOT> | |
<TCEforms> | |
<sheetTitle>Page 1</sheetTitle> | |
</TCEforms> | |
<type>array</type> | |
<el> | |
... | |
</el> | |
</ROOT> | |
</page1> | |
<page2> | |
... | |
</page2> | |
</sheets> | |
</T3DataStructure> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController | |
{ | |
... | |
private function _getFlexFormOptions() | |
{ | |
$this->contentObj = $this->configurationManager->getContentObject(); | |
$piFlexForm = $this->contentObj->data['pi_flexform']; | |
$options = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($piFlexForm); | |
return $options; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment