Brian's Blog

items I see across my tribes

Code Igniter: MVC REST PHP Framework

May 12
by briancarter 12. May 2011 07:44

Are you getting into PHP?  How about MVC or REST?  I’ve been working in RoR and Microsoft MVC.  If you need to use PHP, I'd recommend using an existing framework.  Code Igniter is a MVC Rest based framework written in PHP based on Ruby on Rails (RoR).  This will give you an industry common practice to follow.  Biggest advantage, when you want to move to RoR or MSFT MVC - it follows the same architecture.  Check it out: http://codeigniter.com/

Update:  want to remove the index.php and look like the other RESTful guys?

Apache rewrites would be more suitable if you don't have a need to use CodeIgniter.

In your .htaccess file you'd use something like:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?page=$1 [PT]
Then you can use http://yoursite.com/whatever 
and $_GET['page'] will equal whatever.

Categories: Development


 Questions or Feedback, my contact information is located on my About page.


The opinions, thoughts, and comments made in these blog posts are solely my own (unless otherwise stated). They do not reflect the opinions, thoughts or practices of my employer, my universities, my family, or anyone else. Also, I retain the right to change my mind about anything I publish here without having to go back and edit posts that occurred in the past. 

These are my opinions, or just as likely, someone else's opinions that I leveraged for my own.