0

I'm new to programming. I've been using codeigniter, and Laravel seemed a classy framework to learn. I have this routes:

Route::get('slider', 'AdminController@getSlider');
Route::get('/', 'AdminController@getSlider');

and my controller:

class AdminController extends BaseController {

    public function getSlider(){
        return View::make('list', array('section' => 'slider_home'));
    }

}

"public/" works great. "public/slider" spits NotFoundHttpException.

If there is some data that i should add please tell me.

Thanks, and excuse my english.

UPDATE:

I got it wrong. The correct URL was "public/index.php/slider". Now I need to modify the .htacces to change that.

4

1 回答 1

1

Try this Route :

Route::controller('','AdminController');

Controller :

class AdminController extends BaseController {

public function getIndex(){
    return View::make('list', array('section' => 'slider_home'));
 }
public function getSlider(){
    return View::make('list', array('section' => 'slider_home'));
 }
}

ok you can use public/ and public/slider

于 2013-08-20T17:31:31.383 回答