Laravel 4 Redirects无效

时间:2015-04-27 16:56:49

标签: php redirect laravel-4

我正在尝试在我的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();
        }     
    }
}

0 个答案:

没有答案