public function setFlashData($newdata, $value = '')
    {
        if (is_string($newdata)) {
            $newdata = [$newdata => $value];
        }

        if (!empty($newdata)) {
            foreach ($newdata as $key => $val) {
                $this->newFlashData[$key] = $val;
            }
        }
    }
public function setFlashData($newdata, $value = '')
    {
        if (is_string($newdata)) {
            $newdata = [$newdata => $value];
        }

        if (!empty($newdata)) {
            foreach ($newdata as $key => $val) {
                $this->newFlashData[$key] = $val;
            }
        }
    }
public function setFlashData ( $ newdata , $ value = '' ) { if ( is_string ( $ newdata ) ) { $ newdata = [ $ newdata => $ value ] ; } if ( ! empty ( $ newdata ) ) { foreach ( $ newdata as $ key => $ val ) { $ this -> newFlashData [ $ key ] = $ val ; } } }
Set Flash Data

Set flash data that will persist only until next request
@param mixed  $newdata Flash data array or string (key)
@param string $value   Value for single key
Set Flash Data