simple-flash - Easy, framework agnostic flash notifications.
New version with Templates is out! Yay!

Janaina Medeiros
Cosmic Funnies

shark vs the universe
YOU ARE THE REASON

JBB: An Artblog!

No title available
PUT YOUR BEARD IN MY MOUTH
Lint Roller? I Barely Know Her

No title available
taylor price

titsay

#extradirty
One Nice Bug Per Day

No title available

oozey mess

⁂

Kiana Khansmith
Claire Keane
sheepfilms
RMH

seen from Germany
seen from United States
seen from T1

seen from United States
seen from United States
seen from United Kingdom

seen from Türkiye

seen from United States
seen from France

seen from United Kingdom
seen from South Korea

seen from T1
seen from Türkiye

seen from Germany
seen from United Kingdom

seen from United States
seen from Germany
seen from South Korea

seen from Indonesia
seen from United States
@tamtamchik
simple-flash - Easy, framework agnostic flash notifications.
New version with Templates is out! Yay!
namecase - This package allows you to convert names into the correct case where possible.
So, well, while I was absent, I created a package for fixing names case (LOUIS XIV = Louis XIV). And it collected 46 stars on GitHub. This is my personal record so far!
1k downloads
While I’m working on templates, https://github.com/tamtamchik/simple-flash got 1k downloads in around 5 months. I think it’s not so bad!
Simple Flash featured at http://microphp.org
Simple Flash
Not so long ago I wrote for internal project very simple and easy to use library for Flash notifications for PHP. I called it simple flash.
It’s really easy to use and add to your project, and documentation to it is very simple.
Installation
Just pull in the package through Composer.
composer require tamtamchik/simple-flash
Inside your project make sure to start a session and load Composer autoload to make everything work.
<?php // Start a Session if( !session_id() ) @session_start(); // Initialize Composer Autoload require_once 'vendor/autoload.php';
Warning! This library contains global flash() function, that popentially can break your function with this name. Now you are warned!
Usage
There are 3 ways to use library:
use \Tamtamchik\SimpleFlash\Flash; // instance $flash = new Flash(); $flash->message('Tea.'); // static Flash::message('Earl Gray.'); // function flash()->message('Hot!');
Messages added by calling message($message, $type = 'info') method. In case of calling a function flash() you can pass $message, $type just to function like so: flash('resistance is futile').
Chainig, Shortcuts, Arrays
Because any of creation types return \Tamtamchik\SimpleFlash\Flash instance, so you can always use chainig to add multiple messages. Shortcuts available for all types of base message types. Also you can pass arrays as $message.
flash()->error(['Invalid email!', 'Invalid username!']) ->warning('Warning message.') ->info('Info message.') ->success('Success message!');
Output & Rendering
Out of the box library support 4 different types of messages: error, warning, info, success. So far output is hardcoded, and designed for Bootstrap.
<div class="alert alert-danger" role="alert"> <p>Invalid email!</p> <p>Invalid username!</p> </div> <div class="alert alert-warning" role="alert"><p>Warning message.</p></div> <div class="alert alert-info" role="alert"><p>Info message.</p></div> <div class="alert alert-success" role="alert"><p>Success message!</p></div>
Rendering is simple:
// Rendering specific type $output = flash()->display('error'); // Rendering all flash $output = flash()->display(); // Also rendering possible when you just read flash object as string (string) flash();
Blog on Tumblr.com
Done!
Ok, this is a time to start (once again) blogging. I think it’ll help me to organize my thoughts and may be post some useful articles for people out there in Internet.
Also want to share my ideas here and give some info on projects and technologies I’m working on.
Small bio:
Russian.
3 days ago I turned 28.
I’m happily married since September 12, 2014.