Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow logic in RegisterTrait to customize Flash messages #938

Open
Modicrumb opened this issue Jan 29, 2021 · 1 comment
Open

Allow logic in RegisterTrait to customize Flash messages #938

Modicrumb opened this issue Jan 29, 2021 · 1 comment

Comments

@Modicrumb
Copy link

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?

@ajibarra
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants