Welcome Guest, Not a member yet? Register   Sign In
HMVC Routes: Protected methods result in warning instead of 404
#2

(This post was last modified: 06-20-2017, 02:00 PM by Martin7483.)

Maybe you could use the _remap method in your controllers. Have a check in that method that checks if the called method is public.

remapping-method-calls

You could then use something like this

PHP Code:
public function _remap($method$params = array())
{
 
   ifmethod_exists($this$method) )
 
   {
 
       $reflection = new ReflectionMethod(get_class($this), $method);
 
       if$reflection->isPublic() )
 
       {
 
           return call_user_func_array(array($this$method), $params);
 
       }
 
       else
        
{
 
           show_404();
 
       }
 
   }

 
   show_404();

Reply


Messages In This Thread
RE: HMVC Routes: Protected methods result in warning instead of 404 - by Martin7483 - 06-20-2017, 01:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB