users icon indicating copy to clipboard operation
users copied to clipboard

Allow logic in RegisterTrait to customize Flash messages

Open Modicrumb opened this issue 5 years ago • 1 comments

In register trait the following code exists:

        if ($userSaved) {
            return $this->_afterRegister($userSaved);
        } else {
            $this->set(compact('user'));
            $this->Flash->error(__d('cake_d_c/users', 'The user could not be saved'));

            return;
        }

I kind of want to be able to customize the Flash error message not with translations but with an if block, I might want to change the flash based on certain errors given back from the entity. Would this be worth it to do via an event or something of that nature?

Modicrumb avatar Jan 29 '21 21:01 Modicrumb

@steinkel @rochamarcelo we could configure flash messages in users config. However do we want that specific customization? If so we can implement it in latest version, otherwise we can close the issue

ajibarra avatar Jun 28 '24 07:06 ajibarra