PHP code example of oneup / contao-backend-sortable-list-views

1. Go to this page and download the library: Download oneup/contao-backend-sortable-list-views 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/ */

    

oneup / contao-backend-sortable-list-views example snippets


# contao/dca/tl_my_custom_table.php

// Add sorting flag
$GLOBALS['TL_DCA']['tl_my_custom_table']['list']['sorting']['sortableListView'] = true;

// Add database field
$GLOBALS['TL_DCA']['tl_my_custom_table']['fields']['sorting']['sql'] = 'int(10) unsigned NOT NULL default 0';