From a139193280030a0fef8f735ff1ac1ec45e41db67 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 13 Sep 2014 10:08:21 +0200 Subject: [PATCH] router intro --- 4-http.md | 2 +- 5-router.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/4-http.md b/4-http.md index 4b79d02..6622cb0 100644 --- a/4-http.md +++ b/4-http.md @@ -4,7 +4,7 @@ PHP already has a few things built in to make working with HTTP easier. For example there are the [superglobals](http://php.net/manual/en/language.variables.superglobals.php) that contain the request information. -These are good if you just want to get a quick and dirty script runnin. But if you want to write clean, maintanable, [SOLID](http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29) code, then you will want a class with a nice object oriented interface that you can use in your application. +These are good if you just want to get a small script up and running without much thought on maintenance. But if you want to write clean, maintanable, [SOLID](http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29) code, then you will want a class with a nice object oriented interface that you can use in your application. Once again, you don't have to reinvent the wheel and just install a package. I decided to write my own [HTTP component](https://github.com/PatrickLouys/http) because I did not like the existing components, but you don't have to do the same. diff --git a/5-router.md b/5-router.md index 5560650..81f3137 100644 --- a/5-router.md +++ b/5-router.md @@ -2,4 +2,12 @@ ### Router +With your current setup it does not matter what URL is used to access the application, it will always result in the same response. So let's fix that now. + +I will use [FastRoute](https://github.com/nikic/FastRoute) in this tutorial. But as always, you can pick your own favorite package. + +Alternative packages: [symfony/Routing](https://github.com/symfony/Routing), [Aura.Router](https://github.com/auraphp/Aura.Router), [fuelphp/routing](https://github.com/fuelphp/routing), [Klein](https://github.com/chriso/klein.php) + +By now you know how to install composer packages, so I will leave that to you. + to be continued... \ No newline at end of file