PHP code example of mvo / contao-group-widget

1. Go to this page and download the library: Download mvo/contao-group-widget 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/ */

    

mvo / contao-group-widget example snippets


$GLOBALS['TL_DCA']['tl_content']['fields']['my_group'] = [
    'inputType' => 'group',
    'palette' => ['amount', 'singleSRC', 'text'],   
    'fields' => [
        'amount' => [ // additional field, defined inline
            'inputType' => 'text',
            'eval' => ['tl_class' => 'w50'],
        ],
        '&singleSRC' => [ // let's change some properties of the existing field
            'eval' => ['mandatory' => false],
        ]   
    ],   
    
    // force at least 1, at max 5 elements
    'min' => 1,
    'max' => 5,
    
    // disable ordering (on by default)
    'order' => false,
    
    // store serialized into a blob (default storage backend)
    'sql' => [
        'type' => 'blob',
        'length' => \Doctrine\DBAL\Platforms\MySQLPlatform::LENGTH_LIMIT_BLOB,
        'notnull' => false,
    ],
];