mardi 24 mai 2016

Redirect back with input not working in Laravel

I have a route post called "postContact" and when the post is success I redirect to the same contact.blade.php where place the post:

<form action=""></form>

I want to see a msg if the post have success, but the Input::get('some data') not working to me.

this is my controller resume:

public function postContact($params) {
 //if successful
 $msg_params = array(
      'msg_type' => 'success',
      'msg_text' => 'my text to show',
  );

  return redirect()->back()->withInput($msg_params);
}

But in the contact.blade.php this not working:

@if(isset($msg_type))
<div class="alert"></div>
@endif

The variables not exits...

I don´t want use flash data here, because contact.blade is a module of another external app laravel and can't share sessions.

What is happening here?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1YUqJej
via IFTTT

Aucun commentaire:

Enregistrer un commentaire