PHP code example of oveleon / contao-be-field-dependency
1. Go to this page and download the library: Download oveleon/contao-be-field-dependency 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-be-field-dependency example snippets
'field1' => [
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default '0'",
],
'field2' => [
'exclude' => true,
'inputType' => 'text',
'eval' => ['maxlength'=>64, 'tl_class'=>'w50'],
'sql' => "varchar(64) NOT NULL default ''",
'dependsOn' => [
'field1' => 1 // Displays this field only if the checkbox (field1) has been selected.
]
],