Skip to content

Instantly share code, notes, and snippets.

@alrnz
Last active March 22, 2018 11:37
Show Gist options
  • Save alrnz/c0f00b196d378f5b9150 to your computer and use it in GitHub Desktop.
Save alrnz/c0f00b196d378f5b9150 to your computer and use it in GitHub Desktop.
Integrate Flexform for Plugin TYPO3 (6.2, too)
<?php
namespace Vendor\Exampleext\Controller;
/* ... */
/**
* ExampleController
*/
class ExampleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* action list
*
* @return void
*/
public function listAction() {
$this->view->assign('program', $this->settings['number']);
// ...
}
<?php
// ....
// Include flex forms
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_' . 'LOWERCASE_PLUGINNAME'; // from registerPlugin(...)
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
$pluginSignature,
'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/setup.xml'
);
<?xml version="1.0" encoding="UTF-8"?>
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Flexform für Typo3 Extbase</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>Standardaktion des Plugins</label>
<config>
<type>select</type>
<items>
<numIndex index="0">
<numIndex index="0">Listenansicht</numIndex>
<numIndex index="1">MyController->list</numIndex>
</numIndex>
<numIndex index="1">
<numIndex index="0">Einzelansicht</numIndex>
<numIndex index="1">MyController->show;MyController->edit</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
<settings.program>
<TCEforms>
<label>LLL:EXT:szshareform/Resources/Private/Language/locallang_db.xlf:tx_szshareform_domain_model_story.program</label>
<config>
<type>select</type>
<foreign_table>tx_szshareform_domain_model_program</foreign_table>
<minitems>0</minitems>
<maxitems>1</maxitems>
</config>
</TCEforms>
</settings.program>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment