2017 © Pedro Peláez
 

cakephp-plugin cakephp-api-flash

CakePHP 3 plugin that adds any flash message to the response.

image

cakedone/cakephp-api-flash

CakePHP 3 plugin that adds any flash message to the response.

  • Saturday, October 17, 2015
  • by pedrofs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CakePHP API Flash

This plugin consists of only a component to be used in your controllers in order to set flash message in the serialized response., (*1)

Usage

Load the component in the desired controller:, (*2)

# the initialize method

$this->loadComponent('ApiFlash');

Then just call the ApiFlashComponent#set(key, message) method from any controller method:, (*3)

$this->ApiFlash->set('success', 'You were successfully authenticated!')

It will simply add an array to the flash key in the response body:, (*4)

[
    'flash' => [
        'success' => 'You were successfully authenticated!'
    ]
]

Config

You can configure the key which the array will be set in the response. Simply add a key index to the config of loadComponent call:, (*5)

# the intialize method

$this->loadComponent('ApiFlash', ['key' => 'feedback']);

The Versions

17/10 2015

dev-master

9999999-dev https://github.com/pedrofs/cakephp-api-flash

CakePHP 3 plugin that adds any flash message to the response.

  Sources   Download

Unlicense

The Requires

 

The Development Requires

by Pedro Fernandes Steimbruch

api cakephp cakephp3 flash flash-message