For the last few days I have been working on a project based on CodeIgniter framework. As this was my first CodeIgniter application, problems were bound to show up. It was just a matter of time. My developer machine is powered by Windows XP, and my working environment is based on WAMP version 2.0 that comes packed with PHP 5.2.6. Installing CodeIgnites was a peace of cake.
After few days of development, time has come to move the application to the server where it will be accessed by other developers trough SVN. Deploying was rather painful since I overlooked the obvious. Server that was hosting the files was on Linux. It is know fact that Windows and Linux look at files a bit differently. The thing is, my CodeIgniter application got loaded as far as to the first $this->load->model(’SomeModelName’) part.
All i got was the annoying error Unable to locate the model you have specified. After about an hour of hunting for bugs I realized it was not a bug, just a naming convention problem. It was not actually a in a real sense of a word. For all of you with the same problem, all you need to do is to rename your modul and library names to be lowercase.
Here are some screen shot on how the name of the models should look lika, as well on how the class names and function calls should look like. Just remember, if you start getting this error, then it’s letter case related. Hope this saves someone couple of minutes of their lives.

CodeIgniter
camel case, CodeIgn
I have read tens of articles on Ajax. I fully understand the philosophy behind it (or at least I would like to think so). However, until today I have found a way to execute specific function from specific class ba simply calling it from any type of link (button or regular link). Today I stumbled upon this excellent article from Michael Wales. This article is a demonstration of CodeIgniter’s cool architecture and URL handling. It is simply a thing of beauty.
Just imagine you create a link with href attribute like
http://somesiteofmine.domain/index.php/controlername/controlerfunction/
This link executes some Ajax call to controlername.php file containing controlername class and controlerfunction function.
And all it takes is a little jQuery like
$(document).ready(function() {
$('#ajaxCallSampleLink').click(function(event) {
event.preventDefault();
$('#list').load(this.href);
});
$('#loading').ajaxStart(function() {
$(this).show();
}).ajaxStop(function() {
$(this).hide();
});
$('#list').ajaxStart(function() {
$(this).hide();
}).ajaxStop(function() {
$(this).show();
});
});
Please follow the link to Michael Wales original article in order to read full tutorial and download his original files.
CodeIgniter, jQuery
AJAX, CodeIgniter, jQuery
I have been using FireBug for some time now. Although his prime purpose is for JavaScript debugging I use it mostly for fast drilling down to CSS stuff. I just love the possibility to change, delete or add CSS properties on HTML document on the fly. Anyway I like FireBug. In absence of one for all IDE it’s quite decent solution for debugging.
Contrast to JavaScript development I do a lot of PHP development. Sadly to say, I am hugely disappointed to PHP debugging solutions. I know there are few solutions out there like XDebug but they are simply no match to Microsoft’s Visual Studio debugger. Anyhow, a free is a free so be grateful. Read more…
CodeIgniter, PHP
CodeIgniter, debugg, FirePHP, PHP
Recent comments