Skip to content

Shouldn't FlashMessage helper method "error()" be named "danger()"? #313

Closed
@ManoelLobo

Description

As the "-error" suffix was changed in BS 3.0 in favour of "-danger", shouldn't the helper method "FlashMessage::error()" be renamed (or aliased) as "FlashMessage::danger()"? Given that in Twig the convention used for , e.g., labels is "label_danger()", it seems a bit counterintuitive.

An adition like

\\ Braincrafted\Bundle\BootstrapBundle\Session\FlashMessage.php

...
    /**
     * Sets a danger message.
     * Conforms with Bootstrap 3 suffix.
     *
     * @param string $message The message
     *
     * @return void
     */
    public function danger($message)
    {
        $this->error($message);
    }
...

should do the trick as an alias, but maybe something deeper would be required for a long term change.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions