PHP code example of xddesigners / silverstripe-better-tabs

1. Go to this page and download the library: Download xddesigners/silverstripe-better-tabs 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/ */

    

xddesigners / silverstripe-better-tabs example snippets


$fields->fieldByName('Root.Deep')
    ->setMode('dropdown')
    ->setIcon('fa-solid fa-layer-group')
    ->setColor('#16a085');

$fields->fieldByName('Root.Main')->setIcon('block-content');   // a leaf Tab (native)
$fields->fieldByName('Root.Settings')->setIcon('cog');         // a TabSet (tab group)

$fields->fieldByName('Root.Media')->setIcon('fa-solid fa-photo-film');

$fields->fieldByName('Root.Alerts')->setColor('#ffcc00');            // text colour
$fields->fieldByName('Root.Live')->setColor('#ffffff', '#c0392b');   // text + background
$fields->fieldByName('Root.Live')->setIconColor('#2ecc71');          // colour just the icon

$fields->fieldByName('Root.Deep')->setMode('dropdown'); // or ->enableDropdown()

$fields->fieldByName('Root')->enableBreadcrumbs();           // nested paths only (2+ levels)
$fields->fieldByName('Root')->enableBreadcrumbs(true, true); // every tab, even top-level leaves

$fields->fieldByName('Root.Deep')->enableBreadcrumbs();