-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflashmessages.tpl
25 lines (25 loc) · 956 Bytes
/
flashmessages.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{*
* Used for displaying error messages / success messages.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright 2013-2023 Jacques Marneweck. All rights strictly reserved.
*}
{* Slim 1.x / 2.x *}
{if isset($smarty.session.flash.errors)}<div class="alert alert-danger" role="alert">{$smarty.session.flash.errors.0}</div>{/if}
{* Slim 3.x *}
{if isset($flash)}
{assign var="flashmsgs" value=$flash->getMessages()}
{if isset($flashmsgs['errors'])}
{foreach $flashmsgs['errors'] item=error}
<div class="alert alert-{if !isset($errorclass)}primary{else}{$errorclass|escape}{/if}" role="alert">{$error}</div>
{/foreach}
{/if}
{if isset($flashmsgs['success'])}
{foreach $flashmsgs['success'] item=success}
<div class="alert alert-success" role="alert">{$success}</div>
{/foreach}
{/if}
{/if}