Posts tagged ‘design’

PHP Framework CodeIgniter or CodeLighter

I been putting up a fuss lately between choosing to use CodeIgniter or Codelighter.

For those that do not know what CodeIgniter is, it is a very small but powerful MVC based PHP framework for developing web applications. And for those who not sure what CodeLighter is, it is mini version of CodeIgniter, it follows the same syntax in general but the actual framework is minimized to the core.

Some nice things of CodeIgniter is that it has a separate documentation and lots of useful helpers and functions. This is a full framework so everything in it is separated from each part for the code like routes, hooks, core classes and so on.

CodeLighter has every core class like dispatcher controller loader and such placed in one single file. If you are the type that likes simplicity then this is good for you. Even thought it is in one file it is all very well commented and there is no need for documentation separately. It is very easy to go through the code and understand what each thing does and makes it easy to edit to your likes. CodeLighter of course supports the full MVC but more compact on the configuration end. Separate models, helpers, views and controllers. the whole code it self has only 5 directories and 3 files. One is the index that starts the code the actual CodeLighter core classes and MySQL class, everything else is for you to make.

I tried using both of those frameworks to try them out. The first thing to look at is the page render time. I had both frameworks installed on same server and had them only connect to the database and that is it. The render time of each page has a huge difference. CodeIgniter scored on average of 0.07 seconds at all times and CodeLighter Scored 0.005 seconds on average. The difference in loading times is all there and at the end before choosing what you want to use think about what you need it for. The CodeIgniter woulb be good for something heavy that has lots of pages and lots of features. CodeLighter would still be fine but would be better for smaller websites. It is like, what is the point of using a framework if it actually slower then the original code.

Notes:
CodeIgniter is good for beginners that wish to learn MVC structure. Which stands for Module View Controller.
CodeLighter is good for those who are going in depth and wish to know the full mechanics and use a more plain and dynamic MVC framework.

PHP Website Structure and Design

My first website was the most confusing piece of code ever. During my time of writing it I learned some usual things and the common used things. I’ll share some of the nice ways to organize your website structure. Those structures may be simple but effective for your own use. Since I am a PHP power user, I’ll make it a PHP based tutorial. In my point of view, having all pages loaded from index is the best for massive websites. That is because you do not share the internal folders with users and everybody uses one single page for viewing, meaning you can password protect everything else on your server. Continue reading ‘PHP Website Structure and Design’ »