php - how to make a functionality in a layout using laravel 5 -
ok, have partial contact form in layout, , i'm trying inputted data pass full contact view form instead of submitting request via clicking submit button. in partial, has name, email, , phone input. want info populate appropriate input , remaining inputs in full contact form , rest blank waiting users input them. naturally on submit sends out. full contact form working, need partial on layout work. problem it's redirecting view that's method. myself don't idea, it's job , want. preferr not have make view. have far
the layout form:
{!! form::open(array('url' => 'contact_index')) !!} <div class="form-group"> {!! form::label('name:') !!} {!! form::text('name', null, ['class' => 'form-control', 'placeholder' => '', 'size' => '25']) !!} </div> <div class="form-group"> {!! form::label('email:') !!} {!! form::email('email', null, ['class' => 'form-control', 'placeholder' => '', 'size' => '25']) !!} </div> <div class="form-group"> {!! form::label('phone:') !!} {!! form::text('phone', null, ['class' => 'form-control', 'placeholder' => '', 'size' => '25']) !!} </div> <br/> <div class="form_group"> {!! form::submit('submit', ['class' => 'btn btn-primary form-control']) !!} </div> {!! form::close() !!}
this controller redirects to
public function index() { $email = input::get('email'); $name = input::get('name'); $phone = input::get('phone'); session_start(); $_session['name'] = $name; $_session['email'] = $email; $_session['phone'] = $phone; return view('contact_views.index',compact('email','name','phone')); }
this view of full contact:
{!! form::open(array('url' => 'contact')) !!} <div class="form-group"> {!! form::label('email:') !!} {!! form::email('email', null, ['class' => 'form-control', 'placeholder' => '', value =>'$_session['email']', size' => '25']) !!} </div> <div class="form-group"> {!! form::label('name:') !!} {!! form::text('name', null, ['class' => 'form-control', 'placeholder' => '', value =>'$_session['name']', 'size' => '25']) !!} </div> <div class="form-group"> {!! form::label('phone:') !!} {!! form::text('phone', null, ['class' => 'form-control', 'placeholder' => '', value =>'$_session['phone']', 'size' => '25']) !!} </div> <div class="form-group"> {!! form::label('subject:') !!} {!! form::text('subject', null, ['class' => 'form-control', 'placeholder' => '', value =>'', 'size' => '25']) !!} </div> <div class="form-group"> {!! form::label('message:') !!} {!! form::textarea('message', null, ['class' => 'form-control', 'placeholder' => '', value =>'', 'size' => '25x12']) !!} </div> <br/> <div class="form_group"> {!! form::submit('submit', ['class' => 'btn btn-primary form-control']) !!} </div> {!! form::close() !!}
as of error i'm getting fatalerrorexception in b6da938076cfb151c583150cb7d0dec6 line 51: syntax error, unexpected 'email' (t_string), expecting ']'
.
you have single quote on line next "size" variable
'placeholder' => '', value =>'$_session['email']', size' => '25']) !!}
Comments
Post a Comment