Adding items to User Account Menu
3
If you want to add menu items under the User Account Menu, do the following:
\System\Classes\SettingsManager::instance()->registerCallback(function ($manager) {
$manager->registerSettingItems('October.Backend', [
'item1' => [
'label' => 'My Test Item',
'url' => Backend::url('<replace url here>'),
'category' => 'MyCategory',
'context' => 'mysettings',
],
'item2' => [
'label' => 'My Test Item 2',
'url' => Backend::url('<replace url here>'),
'category' => 'MyCategory',
'context' => 'mysettings',
],
]);
});
Use removeSettingItem()
method to remove items.
Just wanted to throw this in that you can also remove these settings items:
Where should we put this function into? Which file?
You should add this code in any plugin register() or boot() method.