trongate / trongate-framework

The Trongate PHP framework
https://trongate.io
Other
1.11k stars 100 forks source link

flashdata, $color not used #149

Closed neoxnitro closed 10 months ago

neoxnitro commented 1 year ago

I remarked that the flashdata $color parameter in function set_flashdata never used in flashdata function, i don't know if is purpose, I localy modified with the following code in order to have different colors.

function flashdata($opening_html=null, $closing_html=null) {
    if (isset($_SESSION['flashdata'])) {
        if (!isset($opening_html)) {
            $opening_html = "";
            if(isset($_SESSION['flashdata_color'])){
                $opening_html = '<p style="color: '.$_SESSION["flashdata_color"].';">';
            }else{
                $opening_html = '<p style="color: green;">';
            }
trongate commented 10 months ago

I think your idea is good but storing the color on a session variable seems a bit strange to me. We have added some kind of customisation with flashdata since your post was created. I'd like to apologise for my sloppy response with this and if you think there's something worth looking into, please resubmit. I promise to be more responsive next time.