Flash message not displaying CakePHP 1.3

506 Views Asked by At

I have a controller which checks a date range and if there is a problem it displays a message. I have installed the application on a new server and suddenly the flash-message isn't displaying when the user selects an invalid date range. I am using the same hosting company so essentially all that has changed is the app url.

The code to display the message is as follows:

// redirect if any errors in date range
        if(count($msg[0])>0){
            $flashmsg = implode('<br />',$msg[0]).implode('<br />',$msg[1]);
            $this->Session->setFlash(__($flashmsg, true),'default', array('class' => 'flash-message-success'));
            $this->redirect(array('action' => 'feedback'));
        }

The feedback() function is simply setting the layout to use.

Any advice would be greatly appreciated...

2

There are 2 best solutions below

0
On

it turned out the issue was due to some incorrect paths within the application due to hard-coding of same.

0
On

There is option in cakephp to disable or enable falsh message. Open app/config/core.php search debug and you can find this

Configure::write('debug', 1);

most probabaly your line must be like this

Configure::write('debug', 1);

change its as above code..Hope it will escape you from this problem And try with some sample word instead of php var.After getting this you replace it with your code.best f luck