Download the PHP package spanky/flasher without Composer

On this page you can find all versions of the php package spanky/flasher. 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 flasher

Flasher

A simple PHP (5.3+) package to ease the process of displaying feedback to users of your website as they interact with it.

This package comes in handy when you want to provide some feedback to the user on the next page load, after they complete certain actions on your site. For example, a messaging confirming that they have successfully signed up, or deleted their account.

Installation

The easiest and best way to install the package is via Composer. Add the package to your requirements, and .

Once the package has been installed, ensure the Composer autoloader is required before trying to use Flasher.

Usage

To get up and running, first we need to make an instance of the class.

To do so, simply call the method on the class.

If using the implementation (the default) to store messages between page loads, ensure that the session is started before initialising the package:

Setting messages

To set a message to be displayed on the next page load, call the method, passing in the content of the message.

The first parameter is the content of the message you wish to be displayed to the user. This must be either a string, or an object implementing the method.

Notice how you can specify an optional string to denote the type of message being provided as either the second parameter of the method.

If you wish, you can also add messages of a specific type in the following way:

Displaying messages

When it comes to actually displaying the messages to the user, there are a few methods to help you do this with the most flexibility.

First, we check if there are any messages to display using the method, which returns either or depending on whether or not there are messages to show.

If there are messages, then we retrieve them by calling the method, which returns an instance of , containing objects representing the messages.

The type of a message can be retrieved by calling the method on the object, and the actual content by calling the method, or casting the object to a string.

Displaying only messages of a certain type

To only check for, or display, messages of a certain type, pass the type string into the and methods, like so:

Displaying only the first, or last message

In some instances, you might not want to display all the messages, but just the first, or last. You can do this easily, by using the or methods on the class.

Using with Laravel

If you're using this package with Laravel, then you can take advantage of the provided service provider and facade to skip the bootstrapping.

First, add to the list of in your file.

Next, add the following key/value pair to the list of in the same file.

You are now free to use the package by statically calling method names of the class on the "facade" class:

Tests

Run to trigger the test suite.


All versions of flasher with dependencies

PHP Build Version
Package Version
No informations.
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 spanky/flasher contains the following files

Loading the files please wait ....