I'm a beginner in Laravel and I'm having a problem with routes and controllers. I created a form with the following action:
{{ Form::open(array('action' => 'MatriculasController@formulario' }}
I created a route for this action:
Route::post('formulario', 'MatriculasController@formulario');
The form method of the MatriculaController does some operations with the data received from the form and should return a View:
//função que recebe e manipula os dados do formulario
public function formulario(){
//recebe os dados do formulario
$ra=$_POST['ra'];
$aluno=$_POST['nome'];
$nasc=$_POST['nascimento'];
$responsavel=$_POST['responsavel'];
$cpf=$_POST['cpfResponsavel'];
//verifica se o RA foi fornecido
if (strlen($ra>0)){
$siga = new Siga();
$consultaRA=$siga->conecta("select NOM_PESSOA from supervisor.PESSOA where COD_PESSOA='$ra'");
$resultado=mssql_fetch_array($consultaRA);
$nome=utf8_encode($resultado['NOM_PESSOA']);
return View::make('confirmaIdentidade');
}
.
.
.
}
View Confirmation:
@extends('templates.templateVeterano')
@section('conteudo')
teste
@stop()
The problem is that it is not returning this view and I do not understand why. You are returning a blank page with the url / form.
Does anyone know what I might be doing wrong?