Skip to content

Commit

Permalink
Improved flashdata helper so that FLASHDATA_OPEN and FLASHDATA_CLOSE …
Browse files Browse the repository at this point in the history
…(constants) can be optionally declared in config, giving users the ability to apply custom flashdata CSS, site wide.
  • Loading branch information
trongate committed Aug 28, 2023
1 parent c96bbd7 commit d4ce238
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions engine/tg_helpers/flashdata_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ function flashdata($opening_html=null, $closing_html=null) {

if (isset($_SESSION['flashdata'])) {

if (!isset($opening_html)) {
$opening_html = '<p style="color: green;">';
$closing_html = '</p>';
if(!isset($opening_html)) {
if (defined('FLASHDATA_OPEN') && defined('FLASHDATA_CLOSE')) {
$opening_html = FLASHDATA_OPEN;
$closing_html = FLASHDATA_CLOSE;
} else {
$opening_html = '<p style="color: green;">';
$closing_html = '</p>';
}
}

echo $opening_html.$_SESSION['flashdata'].$closing_html;
unset($_SESSION['flashdata']);
}
Expand Down

0 comments on commit d4ce238

Please sign in to comment.