2017 © Pedro Peláez
 

library mzflash

Session based flash message class. Written for Anax-MVC part of the dbwebb course.

image

nuvalis/mzflash

Session based flash message class. Written for Anax-MVC part of the dbwebb course.

  • Wednesday, May 14, 2014
  • by nuvalis
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

mzFlash

Build Status, (*1)

A PHP Flash Message Class, (*2)

Installation Instructions for Anax-MVC

Register it as an Anax Service like this in your config/frontcontroller or whatever method you prefer., (*3)

$di = new \Anax\DI\CDIFactoryDefault();

// Other Services

$di->setShared('mzflash', function() {
    $mzflash = new \nuvalis\Flash\Message();
    return $mzflash;
});

// Other Services, Controllers etc.

$app = new \Anax\Kernel\CAnax($di);

$app->session //Start Session for mzFlash to work.

You should now be able to use these functions like this., (*4)

// In the Frontcontroller you can do it like this.

$app->mzflash->error("Your Message");
$app->mzflash->success("Your Message");
$app->mzflash->warning("Your Message");
$app->mzflash->message("Your Message");

// If you are in a Controller or Model (Notice the diffrence $app/$this)

$this->mzflash->error("Your Message");
$this->mzflash->success("Your Message");
$this->mzflash->warning("Your Message");
$this->mzflash->message("Your Message");

//To print it out you can use it like this in your Anax-MVC/theme/mytheme/index.tpl.php

<?= $this->mzflash->show(); ?>

// The Output will look something like this

<section class="flash-messages">
    <div class="inner">
        <div class="flash error">Your Message</div>
        <div class="flash success">Your Message</div>
        <div class="flash warning">Your Message</div>
        <div class="flash message">Your Message</div>
    </div>
</section>

Update

[14 May, 2014] Changed variable from flash to mzflash to avoid collision with Anax-MVC's new flash class/service. You can name this service to anything you want., (*5)

The Versions

14/05 2014

dev-master

9999999-dev http://dbwebb.se

Session based flash message class. Written for Anax-MVC part of the dbwebb course.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

message anax flash education anax-mvc mzflash

14/05 2014

v1.0.0

1.0.0.0 http://dbwebb.se

Session based flash message class. Written for Anax-MVC part of the dbwebb course.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

message anax flash education anax-mvc mzflash