PHP Frameworking - Introduction (Part 1)



Since Jan 31, 2015 2 Posts

Really nice and well written. :)

Since Feb 01, 2015 1 Posts

good article. It helps to understand how object oriented programming is implemented.

zooboole Since Jan 22, 2015 117 Posts

Thanks @Matej Sima. This is a lovely post. i like the way you started the post.

zooboole Since Jan 22, 2015 117 Posts

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:

require_once(__DIR__.\'/../core/view/viewLoader.php\');
require_once(__DIR__.\'/../core/view/view.php\');

Or if you are using php version bellow php 5.3 you may have to use this to require files:

require_once(dirname(__FILE__).\'/../core/view/viewLoader.php\');
require_once(dirname(__FILE__).\'/../core/view/view.php\');

Also for those like me who are running it from WAMPSERVER or its mates, run it from:

http://localhost/your-project-folder/public


Reference

zooboole Since Jan 22, 2015 117 Posts

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:

http://localhost/your-project-folder/something

Will always go through public/index.php

I used this for now:

RewriteEngine On
RewriteRule . public/index.php
Benjamin Manford Since Feb 03, 2015 2 Posts

Awesome post!!!

Steve Schiff Since Aug 09, 2015 2 Posts

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!

Steve Schiff Since Aug 09, 2015 2 Posts

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.

Walter Jones Since Aug 17, 2016 1 Posts

This is awesome writing it is very useful for me, thank you for share this information.

custom essay writing service