dimanche 29 novembre 2015

How to get postback data in laravel blade

If I have a form with a hidden input how can I check that value in my blade template upon validation postback?

So in the example below how can I get the value of form_type:

@if (Request::isMethod('post') && $request->form_type == 'login')
   // some stuff 
@elseif (Request::isMethod('post') && $request->form_type == 'register')
  // some other stuff
@endif

 {!! Form::open(['method' => 'POST', 'url' => 'login']) !!}
     {!! Form::hidden('form_type', 'login') !!}
     // some other inputs
 {!! Form::close() !!}

 {!! Form::open(['method' => 'POST', 'url' => 'register']) !!}
     {!! Form::hidden('form_type', 'register') !!}
     // some other inputs
 {!! Form::close() !!}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire