PHP code example of oveleon / contao-config-driver-bundle

1. Go to this page and download the library: Download oveleon/contao-config-driver-bundle 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/ */

    

oveleon / contao-config-driver-bundle example snippets


$GLOBALS['TL_DCA']['tl_newdca'] = array
(
    'config' => array
    (
        'dataContainer'               => 'Config',
        'configFile'                  => 'dcaConfigFile.html5' // Use the extension html5 to make the configuration extensible in the backend. If the configuration must not be changed, choose the extension PHP.
    )
);

$GLOBALS['TL_DCA']['tl_newdca'] = array
(
    'config' => array
    (
        'dataContainer'               => 'Config',
        'ptable'                      => 'tl_theme', 
        'configField'                 => 'configData',
        'configFile'                  => 'dcaConfigFile.html5',
        'multipleConfigFiles'         => true
    )
);

return array(
    'palettes' => array(                                    //
        'default'  => '{font_legend},fontsize,fontcolor'    // Optional
    ),                                                      // 
    'fields'   => array(
        'fontsize' => array
        (
            'label'                   => &$GLOBALS['TL_LANG']['tl_newdca']['fontsize'],
            'inputType'               => 'inputUnit',
            'options'                 => $GLOBALS['TL_CSS_UNITS'],
            'eval'                    => array('

$GLOBALS['BE_MOD']['design']['themes']['tables'][] = 'tl_newdca';

// Add operation
$GLOBALS['TL_DCA']['tl_theme']['list']['operations']['newdca'] = array
(
    'label'               => &$GLOBALS['TL_LANG']['tl_theme']['newdca'],
    'href'                => 'table=tl_newdca',
    'icon'                => 'css.svg',
);

// Add fields
$GLOBALS['TL_DCA']['tl_theme']['fields']['configData'] = array
(
    'inputType'      => 'text',
    'sql'            => "text NULL"
);