Archive

Posts Tagged ‘CodeIgniter’

CodeIgniter, jQuery and Ajax

September 18th, 2008

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 , ,

Setting up FirePHP with CodeIgniter

September 17th, 2008

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 , , ,