daveh / php-mvc

A simple PHP model-view-controller framework, built step-by-step as part of the "Write PHP like a pro: build an MVC framework from scratch" course on Udemy.
https://davehollingworth.com/go/phpmvc/
MIT License
782 stars 311 forks source link

Where i can make routes file #102

Closed dualsyscornd closed 2 years ago

dualsyscornd commented 2 years ago

please explain me

daveh commented 2 years ago

In this framework the routes are defined in the public/index.php file.

robertaonnis commented 2 years ago

Hello, if i insert all the route that i have like: $router->add('', ['controller' => 'Product', 'action' => 'index']);

and i digit localhost/route show me an issue that the route not exist. but fore sure exist.

daveh commented 2 years ago

@robertaonnis The route you added above would match the homepage, e.g. http://localhost/

robertaonnis commented 2 years ago

Yes i Really sorry, I have read all the code yesterday and solve