Really nice and well written. :)
good article. It helps to understand how object oriented programming is implemented.
Thanks @Matej Sima. This is a lovely post. i like the way you started the post.
Perfectly followed the tutorial, it works impec.
For those on windows who may have a problem with the relative include path, think of using DIR like this:
Or if you are using php version bellow php 5.3 you may have to use this to require files:
Also for those like me who are running it from WAMPSERVER or its mates, run it from:
Another thing one could do is to have a .htaccess file in our root folder that will handle our requests. So, every request made like:
Will always go through public/index.php
I used this for now:
RewriteEngine On RewriteRule . public/index.php
Yes, this worked from the start when I copied it as written. When I tried to actually type it all out, not so much. I probably made a few hard-to-spot typos. But this short tutorial works!
I had the same errors as Auto Default. I then moved the 'BASEPATH' definition to the bootstrap.php file and it worked. Not sure why the 'BASEPATH' definition in the config.php wouldn't follow through on the require statement in the bootstrap.php file. I copy/pasted all the code to make sure that it wasn't me making weird typing errors that I couldn't spot. Weird! But nevertheless, this was great little tutorial! It went a long way toward helping me to understand the general nature of how all those php frameworks operate.
This is awesome writing it is very useful for me, thank you for share this information.