PHP Classes

File: App/System/Helpers/Session.php

Recommend this page to a friend!
  Classes of Maicon gonšalez  >  Potato PHP MVC Framework  >  App/System/Helpers/Session.php  >  Download  
File: App/System/Helpers/Session.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Potato PHP MVC Framework
Framework to develop PHP MVC applications
Author: By
Last change:
Date: 9 months ago
Size: 1,935 bytes
 

Contents

Class file image Download
<?php

if (!function_exists('setFlashError')) {
   
/**
     * Setar uma mensagem de error
     * @param $msg
     */
   
function setFlashError($msg){
        \
System\Libraries\Session::getInstance()->setFlash("error", $msg);
    }
}

if (!
function_exists('getFlashError')) {
   
/**
     * Exibir, se houver, uma mensagem de error
     * @return null|string
     */
   
function getFlashError(){
       
$Error = \System\Libraries\Session::getInstance()->getFlash("error");
        if (
$Error) {
            return
"<div class='alert alert-danger'><i class='fa fa-times-circle'></i> {$Error}</div>";
        }
        return
null;
    }
}

if (!
function_exists('setFlashSuccess')) {
   
/**
     * Setar mensagem de successo
     * @param $msg
     */
   
function setFlashSuccess($msg){
        \
System\Libraries\Session::getInstance()->setFlash("success", $msg);
    }
}

if (!
function_exists('getFlashSuccess')) {
   
/**
     * Exibir, se houver, uma mensagem de sucesso
     * @return null|string
     */
   
function getFlashSuccess(){
       
$Success = \System\Libraries\Session::getInstance()->getFlash("success");
        if (
$Success) {
            return
"<div class='alert alert-success'><i class='fa fa-check'></i> {$Success}</div>";
        }
        return
null;
    }
}

if (!
function_exists('setFlashWarning')) {
   
/**
     * Setar mensagem de Alerta
     * @param $msg
     */
   
function setFlashWarning($msg){
        \
System\Libraries\Session::getInstance()->setFlash("warning", $msg);
    }
}

if (!
function_exists('getFlashWarning')) {
   
/**
     * Exibir, se houver, uma mensagem de Alerta
     * @return null|string
     */
   
function getFlashWarning(){
       
$Warning = \System\Libraries\Session::getInstance()->getFlash("warning");
        if (
$Warning) {
            return
"<div class='alert alert-warning'><i class='fa fa-warning'></i> {$Warning}</div>";
        }
        return
null;
    }
}

For more information send a message to info at phpclasses dot org.