Created
April 8, 2016 09:37
-
-
Save astehlik/1990f63f19eecd3daa7f5514eee58178 to your computer and use it in GitHub Desktop.
Custom TYPO3 form field
This file contains hidden or 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 | |
// ... | |
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1460107841] = [ | |
'nodeName' => 'tx_tinyurls_urldisplay', | |
'priority' => 40, | |
'class' => \Tx\Tinyurls\Hooks\UrlDisplayFormElement::class, | |
]; |
This file contains hidden or 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 | |
// TCA config ... | |
return [ | |
// ... | |
'columns' => [ | |
// ... | |
'urldisplay' => [ | |
'config' => [ | |
'type' => 'tx_tinyurls_urldisplay', | |
] | |
], | |
// ... | |
], | |
'types' => [ | |
'0' => [ | |
'showitem' => 'urldisplay...' | |
], | |
], | |
]; |
This file contains hidden or 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 | |
namespace Tx\Tinyurls\Hooks; | |
class UrlDisplayFormElement extends \TYPO3\CMS\Backend\Form\AbstractNode implements \TYPO3\CMS\Backend\Form\NodeInterface | |
{ | |
/** | |
* Main render method | |
* | |
* @return array As defined in initializeResultArray() of AbstractNode | |
*/ | |
public function render() | |
{ | |
$result = $this->initializeResultArray(); | |
$result['html'] = 'Hallo world!'; | |
return $result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment