PHP code example of contaobayern / contao-member-contact-settings

1. Go to this page and download the library: Download contaobayern/contao-member-contact-settings 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/ */

    

contaobayern / contao-member-contact-settings example snippets


$GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter'] = [
    // ...
    'eval' => [
        // ...
        'dependents' => [
            'mandatory' => ['street', 'postal', 'city', 'country'],
            'visibility' => ['street', 'postal', 'city', 'country'],
        ],
        // ...
    ]
]

$GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter']['eval']['dependents']['mandatory'][] = 'state';
$GLOBALS['TL_DCA']['tl_member']['fields']['contactLetter']['eval']['dependents']['visibility'][] = 'state';

$GLOBALS['TL_DCA']['tl_member']['fields']['myCheckbox']['eval']['dependents'] = [
    'mandatory' => ['fieldA', 'fieldB', 'fieldC'],
    'visibility' => ['fieldA', 'fieldB', 'fieldC'],
];