Defining Sections


Related Links

Introduction

Module sections are the primary navigation for modules. They are defined in the module class:

protected $sections = [
    'books'
];

You can read more about section in the control panel documentation.

Buttons

Sections can define buttons that allow you to take action within the active section.

Buttons are defined in the section's buttons definition:

protected $sections = [
    'books' => [
        'buttons' => [
            'add_book',
            'view_books' => [
                'href' => '/library/books',
                'target' => '_blank',
            ],
        ]
    ]
];

You can read more about button definitions in the control panel documentation.