-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Table
HTML Table Generating Class
Lets you create tables manually or from database result objects, or arrays.
- Class name: CI_Table
- Namespace:
public array $rows = array()
Data for table rows
- Visibility: public
public array $heading = array()
Data for table heading
- Visibility: public
public boolean $auto_heading = TRUE
Whether or not to automatically create the table header
- Visibility: public
public string $caption = NULL
Table caption
- Visibility: public
public array $template = NULL
Table layout template
- Visibility: public
public string $newline = "\n"
Newline setting
- Visibility: public
public string $empty_cells = ''
Contents of empty cells
- Visibility: public
public \function $function = NULL
Callback for custom table layout
- Visibility: public
void CI_Table::__construct(array $config)
Set the template from the table config file if it exists
- Visibility: public
- $config array - <p>(default: array())</p>
boolean CI_Table::set_template(array $template)
Set the template
- Visibility: public
- $template array
\CI_Table CI_Table::set_heading($args)
Set the table heading
Can be passed as an array or discreet params
- Visibility: public
- $args mixed
array CI_Table::make_columns(array $array, integer $col_limit)
Set columns. Takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns. This allows a single array with many elements to be displayed in a table that has a fixed column count.
- Visibility: public
- $array array
- $col_limit integer
\CI_Table CI_Table::set_empty(mixed $value)
Set "empty" cells
Can be passed as an array or discreet params
- Visibility: public
- $value mixed
\CI_Table CI_Table::add_row($args)
Add a table row
Can be passed as an array or discreet params
- Visibility: public
- $args mixed
array CI_Table::_prep_args($args)
Prep Args
Ensures a standard associative array format for all cell data
- Visibility: protected
- $args mixed
\CI_Table CI_Table::set_caption(string $caption)
Add a table caption
- Visibility: public
- $caption string
string CI_Table::generate(mixed $table_data)
Generate the table
- Visibility: public
- $table_data mixed
\CI_Table CI_Table::clear()
Clears the table arrays. Useful if multiple tables are being generated
- Visibility: public
void CI_Table::_set_from_db_result($object)
Set table data from a database result object
- Visibility: protected
- $object mixed
void CI_Table::_set_from_array(array $data)
Set table data from an array
- Visibility: protected
- $data array
void CI_Table::_compile_template()
Compile Template
- Visibility: protected
array CI_Table::_default_template()
Default Template
- Visibility: protected