PHP code example of bit3 / contao-deeplinks

1. Go to this page and download the library: Download bit3/contao-deeplinks 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-deeplinks example snippets


$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&id=1',
	'search'     => 'do=my_menu&table=tl_my_table&id=1',
	'deepsearch' => true,
	'priority'   => 10,
);

$GLOBALS['BE_MOD']['my_module']['my_menu'] = array(
	'tables'     => array('tl_my_table', 'tl_my_sub_table'),
	'icon'       => 'system/modules/my_module/assets/images/my_menu.png',
);

$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&id=1',
	'search'     => 'do=my_menu&table=tl_my_table&id=1',
	'priority'   => 10,
);
$GLOBALS['BE_MOD']['my_module']['my_deeplink_edit'] = array(
	'icon'       => 'system/modules/my_module/assets/images/my_deeplink.png',
	'deeplink'   => 'do=my_menu&act=edit&id=1',
	'search'     => 'do=my_menu&act=edit&table=tl_my_table&id=1',
	'priority'   => 11,
);

$GLOBALS['TL_EVENTS']['deeplinks-create'][] = array('MyClass', 'eventShortcutsCreate');

class MyClass
{
	static public function eventShortcutsCreate()
	{
		$database = \Database::getInstance();

		// fetch items from database and create
		// the items in $GLOBALS['BE_MOD'] dynamically
	}
}

$GLOBALS['BE_MOD']['my_module']['my_deeplink'] = array(
	...
	'callback' => 'Bit3\Contao\Deeplinks\Deeplinks',
);