CodeIgniter Method Chaining

In this tutorial you will learn about the CodeIgniter Method Chaining and its application with practical example.

What Method Chaining In CodeIgniter?

In CodeIgniter, method chaining enables us to connect multiple method calls in single statement. Method chaining simplifies the syntax required to call multiple methods sequential over single object. Each of the method returns an object, without requiring intermediate variables to hold the results. Method chaining reduces the amount of code and improves the readability of code.

Example:- Let’s say you have a MySQL table named ’employee_master’ with the following fields –
emp_ID, emp_name, emp_email, emp_phone, emp_address, emp_code and emp_dept

 

 

In this tutorial we have learn about the CodeIgniter Method Chaining and its application with practical example. I hope you will like this tutorial.