Question

I am currently creating a 'edit profile' page, where the user can edit their current information. The information is passed from the controller where it can be accessed through Blade (I've tested it):

{{ $details->title }}

I want this to be the value inside the text field so they know what information is currently stored about them.

<div class="form-group">
    {{ Form::label('Title', 'Title') }}
    {{ Form::text('title', null, array('class'=>'form-control', 
    'value'=>'{{{ $details->title }}}')) }}

</div>

With 2 brackets as well, but to no success.

Any help would be greatly appreciated.

Was it helpful?

Solution

You may try this:

{{ Form::text('title', Input::old('title') ?
                       Input::old('title') :
                       ($details ? $details->title : ''),
                       array('class'=>'form-control')) }}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top