mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
DOCS Added a useful code example around positioning of tabs in CMS.
This useful example wasn't in the docs when I needed it. I ended up tracking this information down at http://stackoverflow.com/questions/5033028/silverstripe-how-do-i-insert-a-tab-before-another-tab It should really be in the docs.
This commit is contained in:
parent
8566825194
commit
14044fff35
@ -126,13 +126,17 @@ A field can be appended to the [api:FieldList].
|
||||
$fields = $form->Fields();
|
||||
|
||||
// add a field
|
||||
$fields->push(new TextField(..));
|
||||
$fields->push(TextField::create(..));
|
||||
|
||||
// insert a field before another one
|
||||
$fields->insertBefore(new TextField(..), 'Email');
|
||||
$fields->insertBefore(TextField::create(..), 'Email');
|
||||
|
||||
// insert a field after another one
|
||||
$fields->insertAfter(new TextField(..), 'Name');
|
||||
$fields->insertAfter(TextField::create(..), 'Name');
|
||||
|
||||
// insert a tab before the main content tab (used to position tabs in the CMS)
|
||||
$fields->insertBefore(Tab::create(...), 'Main');
|
||||
// Note: you need to create and position the new tab prior to adding fields via addFieldToTab()
|
||||
|
||||
Fields can be fetched after they have been added in.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user