Sunday, 15 February 2015

php - Data is not being passed with redirect -


Below route is the code of the redirect. I am trying to use $ success to achieve successful success, but it is giving the "irreversible variable: success" error. I also tried to pass the data in the array format with the method. How can I fix this?

  If ($ data-> Save ()) Redirect redirect ('/ cases / ppost / notification') - & gt; ('Success', 'your case has been posted'.) - & gt; Together ('case number', $ data-> ID);  

According to the documentation redirect () -> With () method does not specify any data in your view, but it flashs in session:

Flash data with a Redirection

Redirection on a new URL and flashing data in session is usually done at the same time. Therefore, for convenience, you can create redirection examples and flash data in sessions in a method series:

Redirect ('user / login') -> ('message', 'login fails ');

This means that you have to access it in your view. This would probably be something like this:

  @if (session :: is ('message')) & lt; Div class = "alert alert-info" & gt; {{Session :: Mill ('Message')}} & lt; / Div & gt; @endif  

No comments:

Post a Comment