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

[NFR] Abilty to change the flash html template #13445

Closed
JABirchall opened this issue Jul 17, 2018 · 1 comment
Closed

[NFR] Abilty to change the flash html template #13445

JABirchall opened this issue Jul 17, 2018 · 1 comment
Assignees
Milestone

Comments

@JABirchall
Copy link

JABirchall commented Jul 17, 2018

I recently ran into this. unless you pure bootstrap template the flash service is pretty useless and you need to write a custom flash class if you dont use bootstrap or have different template for errors and stuff like that.

Should add another method, setHtmlTemplate

$di->set('flash', function () {
    $flash = new Flash();
    $flash->setCssClasses([
        'error'   => 'alert alert-danger',
        'success' => 'alert alert-success',
        'notice'  => 'alert alert-info',
        'warning' => 'alert alert-warning'
    ]);
    $flash->setHtmlTemplate("<div class='{{ css }} alert-dismissible fade show m-alert m-alert--air' role='alert'>
	<button type='button' class='close' data-dismiss='alert' aria-label='Close'></button>
	{{ message }}
    </div>");
    retrun $flash;
});

Proposed version: 4.0 / 3.4.1?

@JABirchall JABirchall changed the title [NFR] Abilty to change the flash message template [NFR] Abilty to change the flash html template Jul 17, 2018
@stale stale bot added the stale Stale issue - automatically closed label Oct 15, 2018
@niden niden self-assigned this Oct 15, 2018
@stale stale bot removed the stale Stale issue - automatically closed label Oct 15, 2018
@niden niden added this to the 4.0.0 milestone Oct 16, 2018
@niden
Copy link
Sponsor Member

niden commented Oct 18, 2018

This has been implemented

@niden niden closed this as completed Oct 18, 2018
@niden niden added this to Done in 4.0.0 Release Dec 7, 2018
@phalcon phalcon deleted a comment from stale bot Jun 20, 2019
@niden niden added the 4.0 label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
4.0.0 Release
  
Done
Development

No branches or pull requests

3 participants