private function _callControllerMethod()
    {
        $length = count($this->_url);

        // Make sure the method we are calling exists
        if ($length > 1) {
            if (!method_exists($this->_controller, $this->_url[1])) {
                $this->_error();
            }
        }

        // Determine what to load
        switch ($length) {
            case 5:
                //controller->Method(Param1, Param2, Param3)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2], $this->_url[3], $this->_url[4]));
                break;

            case 4:
                //controller->Method(Param1, Param2)
                $this->_controller->{$this->_url[1]}($this->_url[2], $this->_url[3]);
                break;

            case 3:
                //Controller->Method(Param1, Param2)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2]));
                break;

            case 2:
                //controller->Method(Param1, Param2)

                $this->_controller->{strtolower($this->_url[1])}();
                break;

            default:
//                $this->_controller->index();
                $this->_controller->index();

                break;
        }
    }
private function _callControllerMethod()
    {
        $length = count($this->_url);

        // Make sure the method we are calling exists
        if ($length > 1) {
            if (!method_exists($this->_controller, $this->_url[1])) {
                $this->_error();
            }
        }

        // Determine what to load
        switch ($length) {
            case 5:
                //controller->Method(Param1, Param2, Param3)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2], $this->_url[3], $this->_url[4]));
                break;

            case 4:
                //controller->Method(Param1, Param2)
                $this->_controller->{$this->_url[1]}($this->_url[2], $this->_url[3]);
                break;

            case 3:
                //Controller->Method(Param1, Param2)
                $this->_controller->{strtolower($this->_url[1])}(strtolower($this->_url[2]));
                break;

            case 2:
                //controller->Method(Param1, Param2)

                $this->_controller->{strtolower($this->_url[1])}();
                break;

            default:
//                $this->_controller->index();
                $this->_controller->index();

                break;
        }
    }
private function _callControllerMethod ( ) { $ length = count ( $ this -> _url ) ; // Make sure the method we are calling exists if ( $ length > 1 ) { if ( ! method_exists ( $ this -> _controller , $ this -> _url [ 1 ] ) ) { $ this -> _error ( ) ; } } // Determine what to load switch ( $ length ) { case 5 : //controller->Method(Param1, Param2, Param3) $ this -> _controller -> { strtolower ( $ this -> _url [ 1 ] ) } ( strtolower ( $ this -> _url [ 2 ] , $ this -> _url [ 3 ] , $ this -> _url [ 4 ] ) ) ; break ; case 4 : //controller->Method(Param1, Param2) $ this -> _controller -> { $ this -> _url [ 1 ] } ( $ this -> _url [ 2 ] , $ this -> _url [ 3 ] ) ; break ; case 3 : //Controller->Method(Param1, Param2) $ this -> _controller -> { strtolower ( $ this -> _url [ 1 ] ) } ( strtolower ( $ this -> _url [ 2 ] ) ) ; break ; case 2 : //controller->Method(Param1, Param2) $ this -> _controller -> { strtolower ( $ this -> _url [ 1 ] ) } ( ) ; break ; default : //                $this->_controller->index(); $ this -> _controller -> index ( ) ; break ; } }
If a method is passed in the GET url paremter.

http://localhost/Controller/method/(param)/(param)/(param)
url[0] = Controller
url[1] = Method
url[2] = Param
url[3] = Param
url[4] = Param
If a method is passed in the GET url paremter .