2017 © Pedro Peláez
 

library flashbundle

Symfony bundle for for managing flash messages

image

ajt/flashbundle

Symfony bundle for for managing flash messages

  • Tuesday, June 30, 2015
  • by AndrewTarry
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,444 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 8 % Grown

The README.md

Flash Bundle

Build Status SensioLabsInsight, (*1)

The AJT Flash Bundle will manage the use of Symfony flash messages with a simple API., (*2)

Usage

Inject the Flash service into any service, (*3)

<argument type="service" id="ajt.flash" />

Use it in service, (*4)

class MyClass
{

    private $flash;

    public function __construct(FlashInterface $flash)
    {
        $this->flash = $flash;
    }

    public function goThings()
    {
        ...
        $this->flash->success("Well done");
    }
}

Use the twig function in your template,, (*5)

{{ ajt_flash() }}

Or if you want to only display some types of message, (*6)

{{ ajt_flash('error') }}

Standard Types

By default the Flash bundle will support the standard bootstrap alert types., (*7)

// Set a custom type

$flash->set('my message', 'myType');

// Bootstrap
$flash->success('my message');
$flash->error('my message');
$flash->info('my message');
$flash->warning('my message');

Custom Css

Custom css classes can be set by modifying config., (*8)

ajt_flash:
    default_class: alert # Added to every flash

    # CSS to add to the standard flash types - default to bootstrap
    core:
        success: alert-success
        error: alert-danger
        info: alert-info
        warning: alert-warning

    # Add a custom flash type called myType with the css myCss
    custom:
        myType:
            type: myType
            css: myCss

The Versions

30/06 2015

dev-master

9999999-dev

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

30/06 2015

1.5.0

1.5.0.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

17/02 2015

1.4.0

1.4.0.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

17/02 2015

1.3.0

1.3.0.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

06/04 2014

1.2.1

1.2.1.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

06/04 2014

1.2.0

1.2.0.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires

21/03 2014

1.1.0

1.1.0.0

Symfony bundle for for managing flash messages

  Sources   Download

MIT

The Requires

 

The Development Requires