Skip to content

Instantly share code, notes, and snippets.

@muskie9
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muskie9/d7d7dba86df525494948 to your computer and use it in GitHub Desktop.
Save muskie9/d7d7dba86df525494948 to your computer and use it in GitHub Desktop.
A way to create a tab and insert it after the last tab
public function getCMSFields(){
$fields = parent::getCMSFields();
$rootTab = $fields->fieldByName('Root');
$this->extend('updateCMSFields', $fields);
$tabs = $rootTab->getTabSet();
$last = $tabs->last()->name;
$rootTab->insertAfter(Tab::create('FoolashTab'), $last);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment