PHP code example of 3ev / typo3-utils

1. Go to this page and download the library: Download 3ev/typo3-utils library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

3ev / typo3-utils example snippets


\Tev\Typo3Utils\Hook\EntityRegistrar::register('Path\\To\\Hook\\Class');

namespace My\Extension;

class MyIcon extends \Tev\Typo3Utils\Plugin\WizIcon
{
    public function __construct()
    {
        parent::__construct(
            // Your extension's name, with underscores

            'my_ext',

            // The plugin name(s) you'd like the wizicon to be used for

            ['myplugin', 'myotherplugin],

            // Optional. The icon file name

            'ext_icon.png'

            // Optional. The language file you'd like to use

            'locallang.xlf'
        );
    }
}

if (TYPO3_MODE === 'BE') {
    $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['My\\Extension\\WizIcon'] =
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Classes/WizIcon.php';
}

'crtl' => [
    'label_userFunc' => 'Tev\\Typo3Utils\\TCA\\Label->run',
    'label_userFunc_options' => [
        // Required, single field name of array of field names

        'fields' => [
            'first_name',
            'last_name'
        ],

        // Optional, defaults to ' '

        'glue' => ', '
     ]
]

$conf = new \Tev\Typo3Utils\Utility\ExtConf('my_ext');
$conf->get('config_key');

$tsfe = \Tev\Typo3Utils\Utility\Tsfe;
$tsfe->create(1 /*, www.hostname.com */);