finished router part
This commit is contained in:
parent
dcdeaa0f7e
commit
53c4e1e618
4 changed files with 11 additions and 5 deletions
|
@ -34,7 +34,7 @@ echo 'Hello World!';
|
||||||
|
|
||||||
Now let's see if everything is set up correctly. Open up a console and navigate into your projects `public` folder. In there type `php -S localhost:8000` and press enter. This will start the built-in webserver and you can access your page in a browser with `http://localhost:8000`. You should now see the hello world message.
|
Now let's see if everything is set up correctly. Open up a console and navigate into your projects `public` folder. In there type `php -S localhost:8000` and press enter. This will start the built-in webserver and you can access your page in a browser with `http://localhost:8000`. You should now see the hello world message.
|
||||||
|
|
||||||
If there is an error, go back and try to fix it. If you only see a blank page, you will likely have to enable error reporting.
|
If there is an error, go back and try to fix it. If you only see a blank page, check the console window where the server is running for errors.
|
||||||
|
|
||||||
Now would be a good time to commit your progress. If you are not already using git, set up a repository now. This is not a git tutorial so I won't go over the details. But using version control should be a habit, even if it is just for a tutorial project like this.
|
Now would be a good time to commit your progress. If you are not already using git, set up a repository now. This is not a git tutorial so I won't go over the details. But using version control should be a habit, even if it is just for a tutorial project like this.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[<< previous](4-http.md)
|
[<< previous](4-http.md) | [next >>](6-controllers.md)
|
||||||
|
|
||||||
### Router
|
### Router
|
||||||
|
|
||||||
|
@ -72,6 +72,6 @@ $routeDefinitionCallback = function (\FastRoute\RouteCollector $r) {
|
||||||
$dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback);
|
$dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This is already an improvement, but now all the handler code is in the `Routers.php` file. This is not optimal, so let's fix that in the next part.
|
||||||
|
|
||||||
|
[<< previous](4-http.md) | [next >>](6-controllers.md)
|
||||||
to be continued...
|
|
5
6-controllers.md
Normal file
5
6-controllers.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[<< previous](5-router.md)
|
||||||
|
|
||||||
|
### Controllers
|
||||||
|
|
||||||
|
to be continued...
|
|
@ -15,4 +15,5 @@ So let's get started right away with the [first part](1-front-controller.md).
|
||||||
3. [Error Handler](3-error-handler.md)
|
3. [Error Handler](3-error-handler.md)
|
||||||
4. [HTTP](4-http.md)
|
4. [HTTP](4-http.md)
|
||||||
5. [Router](5-router.md)
|
5. [Router](5-router.md)
|
||||||
6. Dependency Injector
|
6. [Controllers](6-controllers.md)
|
||||||
|
7. Dependency Injector
|
Loading…
Reference in a new issue