PHP 클래스 CI_Table, TastyIgniter

Lets you create tables manually or from database result objects, or arrays.
저자: ExpressionEngine Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$auto_heading boolean Whether or not to automatically create the table header
$caption string Table caption
$empty_cells string Contents of empty cells
$function function Callback for custom table layout
$heading array Data for table heading
$newline string Newline setting
$rows array Data for table rows
$template array Table layout template

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Set the template from the table config file if it exists
add_row ( $args = [] ) : CI_Table Add a table row
clear ( ) : CI_Table Clears the table arrays. Useful if multiple tables are being generated
generate ( mixed $table_data = NULL ) : string Generate the table
make_columns ( array $array = [], integer $col_limit ) : array 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.
set_caption ( string $caption ) : CI_Table Add a table caption
set_empty ( mixed $value ) : CI_Table Set "empty" cells
set_heading ( $args = [] ) : CI_Table Set the table heading
set_template ( array $template ) : boolean Set the template

보호된 메소드들

메소드 설명
_compile_template ( ) : void Compile Template
_default_template ( ) : array Default Template
_prep_args ( $args ) : array Prep Args
_set_from_array ( array $data ) : void Set table data from an array
_set_from_db_result ( $object ) : void Set table data from a database result object

메소드 상세

__construct() 공개 메소드

Set the template from the table config file if it exists
public __construct ( array $config = [] ) : void
$config array (default: array())
리턴 void

_compile_template() 보호된 메소드

Compile Template
protected _compile_template ( ) : void
리턴 void

_default_template() 보호된 메소드

Default Template
protected _default_template ( ) : array
리턴 array

_prep_args() 보호된 메소드

Ensures a standard associative array format for all cell data
protected _prep_args ( $args ) : array
리턴 array

_set_from_array() 보호된 메소드

Set table data from an array
protected _set_from_array ( array $data ) : void
$data array
리턴 void

_set_from_db_result() 보호된 메소드

Set table data from a database result object
protected _set_from_db_result ( $object ) : void
리턴 void

add_row() 공개 메소드

Can be passed as an array or discreet params
public add_row ( $args = [] ) : CI_Table
리턴 CI_Table

clear() 공개 메소드

Clears the table arrays. Useful if multiple tables are being generated
public clear ( ) : CI_Table
리턴 CI_Table

generate() 공개 메소드

Generate the table
public generate ( mixed $table_data = NULL ) : string
$table_data mixed
리턴 string

make_columns() 공개 메소드

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.
public make_columns ( array $array = [], integer $col_limit ) : array
$array array
$col_limit integer
리턴 array

set_caption() 공개 메소드

Add a table caption
public set_caption ( string $caption ) : CI_Table
$caption string
리턴 CI_Table

set_empty() 공개 메소드

Can be passed as an array or discreet params
public set_empty ( mixed $value ) : CI_Table
$value mixed
리턴 CI_Table

set_heading() 공개 메소드

Can be passed as an array or discreet params
public set_heading ( $args = [] ) : CI_Table
리턴 CI_Table

set_template() 공개 메소드

Set the template
public set_template ( array $template ) : boolean
$template array
리턴 boolean

프로퍼티 상세

$auto_heading 공개적으로 프로퍼티

Whether or not to automatically create the table header
public bool $auto_heading
리턴 boolean

$caption 공개적으로 프로퍼티

Table caption
public string $caption
리턴 string

$empty_cells 공개적으로 프로퍼티

Contents of empty cells
public string $empty_cells
리턴 string

$function 공개적으로 프로퍼티

Callback for custom table layout
public function $function
리턴 function

$heading 공개적으로 프로퍼티

Data for table heading
public array $heading
리턴 array

$newline 공개적으로 프로퍼티

Newline setting
public string $newline
리턴 string

$rows 공개적으로 프로퍼티

Data for table rows
public array $rows
리턴 array

$template 공개적으로 프로퍼티

Table layout template
public array $template
리턴 array