Download the PHP package arturdoruch/flash-message-bundle without Composer

On this page you can find all versions of the php package arturdoruch/flash-message-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flash-message-bundle

FlashMessageBundle

FlashMessageBundle allows in very convenient way sets or adds flash messages. It's helpful, when we want to give user some response information about controller action status. Flash message manager working with Symfony\Component\HttpFoundation\Session\Flash\FlashBag and every setting message is automatically translated by Symfony\Component\Translation\Translation.

Installation

Install bundle with composer

Add bundle to application kernel.

Configuration

This bundle configured under the artur_doruch_flash_message key in your application configuration.

classes

type: array default:

An array of key-value pairs, where key is a message type and value a css class name. This parameter allows to define string that can be used in template as CSS class name for stylize displaying messages.

To use this parameter in template call ad_flash_messages_class_name(type) function with message type as parameter. See Resources/views/messages.html.twig file.

Controller

Every message setting by service ad_flash_message is automatically translated by Symfony\Component\Translation\Translation.

To get flash message service.

Set, add messages

By default flash messages are translated with "messages" domain. Methods starting with name "add" or "set", adds or sets messages to Symfony\Component\HttpFoundation\Session\Flash\FlashBag, which next we can display in view template.

Difference between methods "set" and "add" is obvious. "add" adds new message into flashBag array collection, while "set" override existing array messages collection by new one.

Get messages

Methods starting with name "get" only prepare message and returns it without adding to Symfony\Component\HttpFoundation\Session\Flash\FlashBag. It's useful if you want to return translated message. For example if you work with REST api or Ajax request.

Instead sets $type by hand you can use these convenient methods.

Add or get messages for CRUD actions.

FlashMessageBundle provides methods for the easy way setting flash messages, when we're doing repetitive CRUD operations. Messages for CRUD action are translated with "crudMessages" domain. See Resources/translations/crudMessages.en.yml file in this bundle.

Example usage

CRUD example.

View

Usage

For displaying flash messages just write this line of code into your base template file or wherever you want.

Optional

This function returns CSS class name related to given message type parameter. Helps to customize displaying messages by CSS style. See how configuration CSS classes names.

Of course you can customize whole messages template by overriding Resources/views/messages.html.twig file. To do this put template file into app/Resources/ArturDoruchFlashMessageBundle/views/messages.html.twig location in your Symfony app.


All versions of flash-message-bundle with dependencies

PHP Build Version
Package Version
Requires twig/extensions Version ~1.0
symfony/framework-bundle Version ^2.8||^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package arturdoruch/flash-message-bundle contains the following files

Loading the files please wait ....