+
Skip to content

Conversation

mhco
Copy link

@mhco mhco commented May 17, 2018

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 added 2 commits May 17, 2018 15:47
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.
$this->url_controller was probably kept away from error pages before so that a redirect could happen. With the new $this->url, that is unnecessary, and adds inconsistency the code. This should fix that.
@gokaybiz
Copy link

gokaybiz commented Sep 7, 2018

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

@gokaybiz
Copy link

gokaybiz commented Sep 7, 2018

        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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载