PHP code example of bit3 / contao-nested-menu

1. Go to this page and download the library: Download bit3/contao-nested-menu 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/ */

    

bit3 / contao-nested-menu example snippets


$GLOBALS['BE_MOD']['my'] = array(
	'entry1' => array(
		'tables' => array('table1'),
	),
	'entry2' => array(
		'tables' => array('table2'),
	),
	'entry3' => array(
		'tables' => array('table3'),
	),
	'entry4' => array(
		'tables' => array('table4'),
	),
	'entry5' => array(
		'tables' => array('table5'),
	),
	'entry6' => array(
		'tables' => array('table6'),
	),
	'entry7' => array(
		'tables' => array('table7'),
	),
	'entry8' => array(
		'tables' => array('table8'),
	),
	'entry9' => array(
		'tables' => array('table9'),
	),
);

$GLOBALS['BE_MOD']['my'] = array(
	'entry1' => array(
		'tables' => array('table1'),
	),
	'entry2' => array(
		'tables' => array('table2'),
	),
	'entry3' => array(
		'tables' => array('table3'),
	),
	'entry4' => array(
		'tables' => array('table4'),
	),
	'entry5' => array(
		'nested' => 'grouped_entries',
		'tables' => array('table5'),
	),
	'entry6' => array(
		'nested' => 'grouped_entries',
		'tables' => array('table6'),
	),
	'entry7' => array(
		'nested' => 'grouped_entries',
		'tables' => array('table7'),
	),
	'entry8' => array(
		'nested' => 'grouped_entries',
		'tables' => array('table8'),
	),
	'entry9' => array(
		'nested' => 'grouped_entries',
		'tables' => array('table9'),
	),
);

$GLOBALS['BE_MOD']['my'] = array(
	'entry1' => array(
		'tables' => array('table1'),
	),
	'entry2' => array(
		'tables' => array('table2'),
	),
	'entry3' => array(
		'tables' => array('table3'),
	),
	'entry4' => array(
		'tables' => array('table4'),
	),
	'grouped_entries' => array(
		'callback' => 'NestedMenuController',
	),
);

$GLOBALS['BE_MOD']['my'] = array(
	'entry1' => array(
		'tables' => array('table1'),
	),
	'entry2' => array(
		'tables' => array('table2'),
	),
	'entry3' => array(
		'tables' => array('table3'),
	),
	'entry4' => array(
		'tables' => array('table4'),
	),
	'entry5' => array(
		'nested' => 'grouped_entries:group1',
		'tables' => array('table5'),
	),
	'entry6' => array(
		'nested' => 'grouped_entries:group1',
		'tables' => array('table6'),
	),
	'entry7' => array(
		'nested' => 'grouped_entries:group2',
		'tables' => array('table7'),
	),
	'entry8' => array(
		'nested' => 'grouped_entries:group2',
		'tables' => array('table8'),
	),
	'entry9' => array(
		'nested' => 'grouped_entries:group3',
		'tables' => array('table9'),
	),
);

$GLOBALS['TL_LANG']['MOD']['grouped_entries:group1'] = 'Group 1';
$GLOBALS['TL_LANG']['MOD']['grouped_entries:group2'] = 'Group 2';
$GLOBALS['TL_LANG']['MOD']['grouped_entries:group3'] = 'Group 3';