From 05c981e1f81192891b05a2f93cd98eaa0c855ba3 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 14 Jan 2015 21:16:39 +0100 Subject: [PATCH] explain __DIR__. solves #13 --- 01-front-controller.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/01-front-controller.md b/01-front-controller.md index 349c513..75315ea 100644 --- a/01-front-controller.md +++ b/01-front-controller.md @@ -22,6 +22,8 @@ Inside the `public` folder you can now create your `index.php`. Remember that yo require __DIR__ . '/../src/Bootstrap.php'; ``` +`__DIR__` is a [magic constant](http://php.net/manual/en/language.constants.predefined.php) that contains the path of the directory. By using it, you can make sure that the `require` always uses the same relative path to the file it is used in. Otherwise, if you call the `index.php` from a different folder it will not find the file. + The `Bootstrap.php` will be the file that wires your application together. We will get to it shortly. The rest of the public folder is reserved for your public asset files (like JavaScript files and stylesheets).