CodeIgniter and JSON with jQuery

In this post, we are going to talk about how to receive data in CodeIgniter via JSON, using for that the JavaScript framework jQuery. But before that, we need to clarify a bit what is JSON and what is it used for.

What is JSON? What is it used for?

JSON stands for JavaScript Object Notation. So, it is a way of writing the properties of objects in JavaScript so that they can be sent between client and server and vice versa. This format is very light due to its internal structure, which is quite human readable, and it is very easy to process by machines. While there is a debate about which format is better, if XML or JSON, for sending and receiving data via AJAX, there is a large community of developers who bet on JSON as the AJAX communication technology that will prevail in the future, alleging among other things that being lighter than XML the communication between client and server is faster. […]

Automatic configuration of URL in CodeIgniter

In this mini-post we are going to explain how to configure our CodeIgniter in order to make it run on any server without having to be modifying the parameter “base_url” in the configuration. So, we can move our development version of our site to another different server (let’s say, the production server), without worrying about this parameter.

Inheritance between controllers in Codeigniter

Today, we will talk about the inheritance between controllers in CodeIgniter. At first glance, it could seem very simple to do and it should not be more complicated than this:

class Parent_controller extends Controller {

    function __construct()
    {
       parent::Controller();
       ...
    }
    ...
}

class Child_controller extends Parent_controller {
    function __construct()
    {
        parent::__construct();
        ...
    }
    ...
}

If we run this code as it is, CodeIgniter will return an error saying that it can not find Parent_controller class, which I founded quite surprising. […]

PHPMailer: Send emails from your site

This time I would like to talk about the library PHPMailer. This library is ideal if you need to send emails from your web site to its users (e.g: for notifying the data suscription, warning about the near account expiration, etc). A very interesting feature offered by this library is allowing us using a GMail account to send emails (of course, we must be the owners of that account). […]

Creating a SOAP server in CodeIgniter

Today I am going to talk about how to create a web services server with the library NuSOAP in CodeIgniter. This post is based on our previous post (Using NuSOAP in CodeIgniter), so I would recommend you to read that post before continuing with this one, since here we use the “pseudo” library nuSoap_lib that we have created earlier. […]