In this initial example, we will see how to use the CI built-in library. Here we will use the CI library CI_Table
as well as the CI_db
library, which, for a given database table/view and some optional CSS settings, will enable us to render the table nicely with all the HTML table tags and CSS settings in just a single line of code. In this example, we will use the same user's table that we used for the controller example in Chapter 3, Usage and Scope of Controllers.
This example will be constructed from the following controller and view:
application/controllers/builtins.php
: This controller loads the built-in CI librarytable
as well as thedb
library, which is autoloaded (for more information, refer to Chapter 2, Configurations and Naming Conventions) to get the user's table content, and set up the table to render using thetable
library.$this->load->library('table');
The controllers prepare vectors of map settings and the list of places and...