Saturday, June 24, 2006

Code Igniter

Today is the first day I start working on Victor's website and it's the first time I start learning the Code Igniter Framework. I watched the two videos and went through the sample of creating a Blog in 20 minutes, then I start implementing the website. It's the first time I use the Model-View-Controller (MVC) approach to build a website and I found the concept of using segments in the URL to represent the MVC approach is interesting. The URI segments is like:

www.your-site.com/class/function/ID
  1. The first segment represents the controller class that should be invoked.
  2. The second segment represents the class function, or method, that should be called.
  3. The third, and any additional segments, represent the ID and any variables that will be passed to the controller.
It really makes a lot of sense when I build the model for simple tables in database, but I also found there is limitation when the tables' relationship is getting complicated.

I also encountered some problems which were tough to a newbie like me:
  1. I couldn't make the views and controllers work if they are in the subfolders of /views/ and /controllers/.
  2. I couldn't make the form validation work.
On the other hand, I found the following classes are very cool and helpful:
  1. Database class - very fast abstracted class and support Active Record patterns.
  2. Pagination class - very easy to customize, but it is a little tricky to make it work with database query. Here is the hint.
I am still experimenting a lot of things and learn this framework by writing Victor's website. I will give a more detailed report later. By the way, here is Victor's website (development server for now) - this will be a simple CMS system contains Blog, photos, and other stuff.

0 Comments:

Post a Comment

<< Home