php - Laravel Routing to non index method in controller -
i trying create route:
route::get('/apply/submit', 'applycontroller@submit');
but keep getting standard laravel error page.
my applycontroller:
class applycontroller extends basecontroller { public function index() { return view::make('apply.apply', array('metatitle' => 'china aupair | internships | apply online')); } public function submit() { return 'yay!'; } }
which don't understand because route::get('/apply', 'applycontroller@index');
works should.
what doing wrong?
i think problem method access page. try send form (using post method) , use get
route. should change:
route::get('/apply/submit', 'applycontroller@submit');
into
route::post('/apply/submit', 'applycontroller@submit');
because send form , not run route manually in browser using http://localhost/yourproject/apply/submit
Comments
Post a Comment