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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -