php - Laravel 4 missingMethod return a blank page? -
i using laravel 4 , have resource in route follows :
route::resource('admin/admins/actions', 'adminactionscontroller'); my adminactionscontroller.php controller has missingmethod follows:
public function missingmethod($parameters = array()) { //show admin users return redirect::to('admin/admins'); } it suppose redirect admin/admins whenever there missing method , when try admin/admins/actions/test , blank page? knows why?
thanks
if through error general controller gives when didn't found function, see it's
public function __call($method, $parameters) { throw new \badmethodcallexception("method [$method] not exist."); } and not missingmethod ( though in documentation says )
if override __call function :
public function __call($method,$parameters = array()) { //show admin users return redirect::to('admin/admins'); } it work intended.
keep in mind example, if have call, example :
admin/admins/actions/foobar it not give missing function, because foobar considered $id, passed show($id) function . if don't have show function, give function missing.
Comments
Post a Comment