Add a custom function to existing controller

Hy

I want to know how to add a custom function to controller “Backend\Controllers\Users” via a plugin.

Thanks

Maybe help you documentation Controllers - October CMS - 3.x

Author\Plugin\Controllers\SomeController::extend(function($controller) {
    if ($controller->getAction() === 'index') {
        // Only do it for the index action
    }

    if ($controller->getParams()[0] ?? null) {
        // Only if first parameter exists
    }
});

Thanks,

i will test it