explain __DIR__. solves #13

This commit is contained in:
Patrick 2015-01-14 21:16:39 +01:00
parent 79e64e3205
commit 31b9f9f57f

View file

@ -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).