【发布时间】:2016-05-04 02:01:01
【问题描述】:
我在将所有数据发布到数据库后尝试重定向到另一个页面。我让它发布数据而无需转到另一个视图,但现在我添加了它也不会执行的视图,我收到此错误:
NotFoundHttpException in RouteCollection.php line 161:
这是我的 routes.php 文件
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::Get('/', function()
{
return View::Make('welcome');
});
Route::Get('registration', function()
{
return View::make('registration');
});
Route::post('registration', function()
{
$user = new \App\User;
$user->UserName = Input::get('UserName');
$user->Password = Hash::make(Input::get('password'));
$user->FirstName = Input::get('FirstName');
$user->LastName = Input::get('LastName');
$user->Gender = Input::get('Gender');
$user->Email = Input::get('Email');
$user->Q1 = Input::get('Q1');
$user->Q2 = Input::get('Q2');
$user->Q3 = Input::get('Q3');
$user->save();
return View::make('welcomepage');
});
任何建议都会很棒。
【问题讨论】: