I'm in a dilemma in Laravel
that I can not solve, and I've tried a lot of things and now I've stuck here: What I want is to give% of a column value of my table by echo
.
Code no input
:
public function retorna_curso()
{
$id_curso = Input::get('id_curso');
$cursos = DB::table('cursos')->get();
$select = DB::table('cursos')->where('id_curso', '=', $id_curso)->get();
return view('editar.update_curso')
->with('select', $select)
->with('cursos', $cursos);
}
Code in html
:
<form action="/updt_curso" method="post">
<div class="form-group col-md-12">
<?php
if(isset($select))
{
echo' <div class="form-group col-md-12">
<label for="edt_nome">Editar nome do curso:</label>
<input type="text"
class="form-control"
name="input_nomeCurso"
value="'.$select['nome'].'"
id="nomeCurso">';
echo'
</div>
<div class="form-group col-md-4">
<input type="submit"
value="Atualizar"
class="form-control btn btn-primary">
</div>';
}
?>
</div>
</form>
It enters Controller
, but gives an exception saying that the View
property does not exist in if
nome
that it sends back to page.
- What could I do to solve this problem?
- What's missing to work?