本文整理汇总了PHP中Flash::getFlashes方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::getFlashes方法的具体用法?PHP Flash::getFlashes怎么用?PHP Flash::getFlashes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::getFlashes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run()
{
$sessao = new TSessao(true);
include 'util/Validacao.php';
$flashes = null;
$usuario = $sessao->getVar('usuario');
include 'app.functions/validate.php';
$valida = validate($usuario);
//include 'relatorios/teste.php';
if ($valida) {
if ($usuario) {
$menu = new TMenu($usuario->permissoes, array('gerenciar'));
TApplication::setStyle('menu');
TApplication::setStyle('controler_bar');
}
if (!$_GET) {
if ($usuario == null) {
require "app.comuns/app.control/login.php";
TApplication::setStyle('login');
$templatePage = "app.comuns/template/login.phtml";
} else {
if ($sessao->getVar('msg1') != null) {
if ($sessao->getVar('msg1') == 5) {
Flash::addFlash('Você não tem permissão!');
$flashes = Flash::getFlashes();
$sessao->removeVar('msg1');
}
}
$templatePage = "app.comuns/template/panel.phtml";
}
} else {
$modulo = isset($_GET['modulo']) ? $_GET['modulo'] : null;
$page = isset($_GET['page']) ? $_GET['page'] : null;
if (file_exists("modulos/{$modulo}/app.control/{$page}.php")) {
require "modulos/{$modulo}/app.control/{$page}.php";
}
if (file_exists("modulos/{$modulo}/template/{$page}.phtml")) {
$templatePage = "modulos/{$modulo}/template/{$page}.phtml";
}
}
if (isset($validacao)) {
if ($validacao !== true) {
$erros = $validacao;
}
}
if (Flash::hasFlashes()) {
$flashes = Flash::getFlashes();
}
if (!isset($_GET['ajax'])) {
TApplication::setStyle('style');
TApplication::setStyle('principal');
TApplication::setStyle('redmond/jquery-ui-1.8.16.custom');
require 'layout/index.phtml';
}
} else {
header('location: index.php');
}
}
示例2: runPage
private function runPage($page, array $extra = array())
{
$run = false;
if ($this->hasScript($page)) {
$run = true;
require $this->getScript($page);
}
if ($this->hasTemplate($page)) {
$run = true;
//required in layout/index.php
$template = $this->getTemplate($page);
$flashes = null;
if (Flash::hasFlashes()) {
$flashes = Flash::getFlashes();
}
require self::LAYOUT_DIR . 'index.php';
}
if (!$run) {
die('Page ' . $page . ' has neither script nor template!');
}
}
示例3: foreach
Flash::addFlash('Here is the warning message', 'warning');
Flash::addFlash('Something wrong happend because it\'s an error message', 'error');
Flash::addFlash('Yeah that\'s work fine, well played', 'success');
Flash::addFlash('In reality I hate php.', 'info');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/styles.css"/>
</head>
<body>
<?php
if (Flash::hasFlashes()) {
foreach (Flash::getFlashes() as $flash) {
echo "<p class=\"flash " . $flash['type'] . "\">" . $flash['message'] . "</p>";
}
}
?>
<h1>Example of utilisation</h1>
<?php
$code = "<?php \n\n\t";
$code .= "// Require the Flash class \n\t";
$code .= "require 'Flash.php';\n\n\t";
$code .= "// Register flashes messages \n\t";
$code .= "Flash::addFlash('Here is the warning message', 'warning');\n\t";
$code .= "Flash::addFlash('Something wrong happend because it\\'s an error message', 'error');\n\t";
$code .= "Flash::addFlash('Yeah that\\'s work fine, well played', 'success');\n\t";
$code .= "Flash::addFlash('In reality I hate php.', 'info');\n\n\t";
$code .= "// If we have one or more messages registered \n\t";
示例4: runPage
private function runPage($page, array $extra = array())
{
$run = false;
if ($this->hasScript($page)) {
$run = true;
require $this->getScript($page);
}
if ($this->hasTemplate($page)) {
$run = true;
// data for main template
$template = $this->getTemplate($page);
$flashes = null;
if (Flash::hasFlashes()) {
$flashes = Flash::getFlashes();
}
// main template (layout)
require self::LAYOUT_DIR . 'index.phtml';
}
if (!$run) {
die('Page "' . $page . '" has neither script nor template!');
}
}