It’s been some time ever since I’ve done much serious coding and decided to get myself updated… with Korean music.
Just joking.
I’ve been doing some research on PHP frameworks. My primary requirements were that the framework supported MVC (most do), is capable of friendly URLs, is simple/easy to use, provides basic wrappers around security (such as XSS and SQL Injection) and most importantly it must have good online support and resources.
I pay particular attention to documentation as it plays an important part to help developers quickly learn/adopt a new framework.
I spent many hours over the weekend reading documentation, installation guides and watching tutorials and eventually settled for CodeIgniter. I found it quite complete and particularly easy to learn. It is well documented, has a good tutorials and did not require that I learn a new template syntax. Above all it deploys really quickly with minimal configuration.
I would like to bring your attention to the Style Guide in the CodeIgniter User Guide. It is very detailed and contains a lot of good coding practices, especially on how braces should be (opening on a new line instead of on the same line) and how PHP tags should be opened (and not necessarily closed). I suggest that PHP developers follow this style guide.
There’s also an add-on to CodeIgniter that I would recommend and that is Grocery CRUD (Create, Retrieve, Update, Delete). Grocery CRUD makes it extremely easy to create a simple maintenance screen for back-end data, especially for short-term projects. It’s certainly better than sending users to phpMyAdmin.
Finally, just to share, here’s my version of .htaccess
file that I use to remove index.php
from the URL. It is largely similar to the example by CodeIgniter with an additional exception for CSS and JavaScript files.
RewriteEngine on RewriteCond $1 !^(index\.php|images|user_guide|robots\.txt|(.*)\.css|(.*)\.js) RewriteRule ^(.*)$ /projects/ci201210/index.php/$1 [L]
That said, I have only done research and not actually used the framework on a full project yet. I’d love to hear any comments and/or recommendations you have.