mini3 icon indicating copy to clipboard operation
mini3 copied to clipboard

Enabled HomeController additional methods

Open mhco opened this issue 7 years ago • 2 comments

If the controller for a specified path doesn't exist, then it will search the HomeController.php for the method. If the method exists in HomeController, it fires it; if the method doesn't exist, it shows the error message.

mhco avatar May 17 '18 19:05 mhco

http://localhost/index/home/index/index http://localhost/home/index/index/index No errors, but bad seo :paintbrush: Needs a little bit fix for unused parameters i think.

gokaybiz avatar Sep 07 '18 00:09 gokaybiz

        if (func_num_args() > 1)
            return (new \Mini\Controller\ErrorController())->index();
        else {
            if (func_get_args() != null && func_get_args()[0] == "do") {
                //doSomething
                header("Location: ".URL);
            } else
                return (new \Mini\Controller\ErrorController())->index();
        }

http://localhost/index/blabla returns error (404). http://localhost/index/do redirects to http://localhost/ successfully. http://localhost/index/xx/xx (more than one parameters) gives error (404) I developed that but I believe there is a better way from my way. Thanks in advance...

gokaybiz avatar Sep 07 '18 01:09 gokaybiz