diff --git a/1-front-controller.md b/01-front-controller.md similarity index 97% rename from 1-front-controller.md rename to 01-front-controller.md index 9814ad2..349c513 100644 --- a/1-front-controller.md +++ b/01-front-controller.md @@ -1,4 +1,4 @@ -[next >>](2-composer.md) +[next >>](02-composer.md) ### Front Controller @@ -40,4 +40,4 @@ If there is an error, go back and try to fix it. If you only see a blank page, c 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. -[next >>](2-composer.md) +[next >>](02-composer.md) diff --git a/2-composer.md b/02-composer.md similarity index 93% rename from 2-composer.md rename to 02-composer.md index dfb9b00..fca4f45 100644 --- a/2-composer.md +++ b/02-composer.md @@ -1,4 +1,4 @@ -[<< previous](1-front-controller.md) | [next >>](3-error-handler.md) +[<< previous](01-front-controller.md) | [next >>](03-error-handler.md) ### Composer @@ -51,4 +51,4 @@ This will exclude the included file and folder from your commits. For which now Now you have successfully created an empty playground which you can use to set up your project. -[<< previous](1-front-controller.md) | [next >>](3-error-handler.md) +[<< previous](01-front-controller.md) | [next >>](03-error-handler.md) diff --git a/3-error-handler.md b/03-error-handler.md similarity index 96% rename from 3-error-handler.md rename to 03-error-handler.md index baa2358..401762c 100644 --- a/3-error-handler.md +++ b/03-error-handler.md @@ -1,4 +1,4 @@ -[<< previous](2-composer.md) | [next >>](4-http.md) +[<< previous](02-composer.md) | [next >>](04-http.md) ### Error Handler @@ -59,4 +59,4 @@ throw new \Exception; You should now see a error page with the line highlighted where you throw the exception. If not, go back and debug until you get it working. Now would also be a good time for another commit. -[<< previous](2-composer.md) | [next >>](4-http.md) +[<< previous](02-composer.md) | [next >>](04-http.md) diff --git a/4-http.md b/04-http.md similarity index 96% rename from 4-http.md rename to 04-http.md index d1ce904..660eece 100644 --- a/4-http.md +++ b/04-http.md @@ -1,4 +1,4 @@ -[<< previous](3-error-handler.md) | [next >>](5-router.md) +[<< previous](03-error-handler.md) | [next >>](05-router.md) ### HTTP @@ -61,4 +61,4 @@ Remember that the object is only storing data, so you if you set multiple status I will show you in later parts how to use the different features of the components. In the meantime, feel free to read the [documentation](https://github.com/PatrickLouys/http) or the source code if you want to find out how something works. -[<< previous](3-error-handler.md) | [next >>](5-router.md) +[<< previous](03-error-handler.md) | [next >>](05-router.md) diff --git a/5-router.md b/05-router.md similarity index 95% rename from 5-router.md rename to 05-router.md index 2bb5c59..a381107 100644 --- a/5-router.md +++ b/05-router.md @@ -1,4 +1,4 @@ -[<< previous](4-http.md) | [next >>](6-dispatching-to-a-class.md) +[<< previous](04-http.md) | [next >>](06-dispatching-to-a-class.md) ### Router @@ -76,4 +76,4 @@ $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-dispatching-to-a-class.md) +[<< previous](04-http.md) | [next >>](06-dispatching-to-a-class.md) diff --git a/6-dispatching-to-a-class.md b/06-dispatching-to-a-class.md similarity index 94% rename from 6-dispatching-to-a-class.md rename to 06-dispatching-to-a-class.md index 52c96e9..3221f44 100644 --- a/6-dispatching-to-a-class.md +++ b/06-dispatching-to-a-class.md @@ -1,4 +1,4 @@ -[<< previous](5-router.md) | [next >>](7-inversion-of-control.md) +[<< previous](05-router.md) | [next >>](07-inversion-of-control.md) ### Dispatching to a Class @@ -53,4 +53,4 @@ So instead of just calling a method you are now instantiating an object and then Now if you visit `http://localhost:8000/` everything should work. If not, go back and debug. And of course don't forget to commit your changes. -[<< previous](5-router.md) | [next >>](7-inversion-of-control.md) \ No newline at end of file +[<< previous](05-router.md) | [next >>](07-inversion-of-control.md) \ No newline at end of file diff --git a/7-inversion-of-control.md b/07-inversion-of-control.md similarity index 93% rename from 7-inversion-of-control.md rename to 07-inversion-of-control.md index 1192545..2200da5 100644 --- a/7-inversion-of-control.md +++ b/07-inversion-of-control.md @@ -1,4 +1,4 @@ -[<< previous](6-dispatching-to-a-class.md) | [next >>](8-dependency-injector.md) +[<< previous](06-dispatching-to-a-class.md) | [next >>](08-dependency-injector.md) ### Inversion of Control @@ -48,4 +48,4 @@ The `Http\HttpResponse` object implements the `Http\Response` interface, so it f Now everything should work again. But if you follow this example, all your objects that are instantiated this way will have the same objects injected. This is of course not good, so let's fix that in the next part. -[<< previous](6-dispatching-to-a-class.md) | [next >>](8-dependency-injector.md) \ No newline at end of file +[<< previous](06-dispatching-to-a-class.md) | [next >>](08-dependency-injector.md) \ No newline at end of file diff --git a/8-dependency-injector.md b/08-dependency-injector.md similarity index 95% rename from 8-dependency-injector.md rename to 08-dependency-injector.md index f4939af..ffd2a61 100644 --- a/8-dependency-injector.md +++ b/08-dependency-injector.md @@ -1,4 +1,4 @@ -[<< previous](7-inversion-of-control.md) | [next >>](9-templating.md) +[<< previous](07-inversion-of-control.md) | [next >>](09-templating.md) ### Dependency Injector @@ -94,4 +94,4 @@ As you can see now the class has two dependencies. Try to access the page with a Congratulations, you have now successfully laid the groundwork for your application. -[<< previous](7-inversion-of-control.md) | [next >>](9-templating.md) \ No newline at end of file +[<< previous](07-inversion-of-control.md) | [next >>](09-templating.md) \ No newline at end of file diff --git a/9-templating.md b/09-templating.md similarity index 97% rename from 9-templating.md rename to 09-templating.md index 373303f..4165ffe 100644 --- a/9-templating.md +++ b/09-templating.md @@ -1,4 +1,4 @@ -[<< previous](8-dependency-injector.md) | [next >>](10-dynamic-pages.md) +[<< previous](08-dependency-injector.md) | [next >>](10-dynamic-pages.md) ### Templating @@ -136,4 +136,4 @@ Now you can go back to your `Homepage` controller and change the render line to Navigate to the hello page in your browser to make sure everything works. And as always, don't forget to commit your changes. -[<< previous](8-dependency-injector.md) | [next >>](10-dynamic-pages.md) +[<< previous](08-dependency-injector.md) | [next >>](10-dynamic-pages.md) diff --git a/10-dynamic-pages.md b/10-dynamic-pages.md index 9d2b789..7a9ae70 100644 --- a/10-dynamic-pages.md +++ b/10-dynamic-pages.md @@ -1,4 +1,4 @@ -[<< previous](9-templating.md) +[<< previous](09-templating.md) ### Dynamic Pages @@ -223,4 +223,4 @@ Try a few different URLs to check that everything is working as it should. If so And as always, don't forget to commit your changes. -[<< previous](9-templating.md) \ No newline at end of file +[<< previous](09-templating.md) \ No newline at end of file diff --git a/README.md b/README.md index 03b3de6..3d02a08 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,17 @@ I saw a lot of people coming into the Stack Overflow PHP chatroom and asking if So my goal with this is to provide an easy resource that people can be pointed to. In most cases a framework does not make sense and writing an application from scratch with the help of some third party packages is much, much easier than some people think. -So let's get started right away with the [first part](1-front-controller.md). +So let's get started right away with the [first part](01-front-controller.md). ### Parts -1. [Front Controller](1-front-controller.md) -2. [Composer](2-composer.md) -3. [Error Handler](3-error-handler.md) -4. [HTTP](4-http.md) -5. [Router](5-router.md) -6. [Dispatching to a Class](6-dispatching-to-a-class.md) -7. [Inversion of Control](7-inversion-of-control.md) -8. [Dependency Injector](8-dependency-injector.md) -9. [Templating](9-templating.md) +1. [Front Controller](01-front-controller.md) +2. [Composer](02-composer.md) +3. [Error Handler](03-error-handler.md) +4. [HTTP](04-http.md) +5. [Router](05-router.md) +6. [Dispatching to a Class](06-dispatching-to-a-class.md) +7. [Inversion of Control](07-inversion-of-control.md) +8. [Dependency Injector](08-dependency-injector.md) +9. [Templating](09-templating.md) 10. [Dynamic Pages](10-dynamic-pages.md)