我正在尝试在我的UserController中使用return Redirect::route('home');
,但它似乎不起作用(显示空白页面)。我已尝试命名路线,但无济于事。
<?php
class UserController extends BaseController {
public $restful = true;
public function get_new()
{
return View::make('users.new')
->with('title', 'Rentaholics - Register');
}
public function post_create() {
$validation = Users::validate(Input::all());
if($validation -> passes()){
Users::create(array(
'username'=>Input::get('username'),
'password'=>Hash::make(Input::get('password')),
'email'=>Input::get('email')
));
return Redirect::to_route('home')->with('message', 'Thanks for Registering!');
}else{
return Redirect::to('register')->with_errors($validation)->with_input();
}
}
}