Documentation

Treeview_custom
in package

Class Treeview_custom

Table of Contents

$prefix  : mixed
$treeResult  : mixed
$dbh  : mixed
$queryArray  : mixed
__construct()  : mixed
Treeview_custom constructor.
__destruct()  : mixed
CreateTreeview()  : mixed
generate_tree_list()  : string

Properties

Methods

__construct()

Treeview_custom constructor.

public __construct( $db_host,  $db_username,  $db_password,  $db_name) : mixed
Parameters
$db_host :
$db_username :
$db_password :
$db_name :
Return values
mixed

CreateTreeview()

public CreateTreeview( $tablename, mixed $category_id[, string $primaryKeyField = 'id' ][, string $titleFieldName = 'title' ][, string $parentRelationFieldName = 'parent_id' ][, string $jqueryNoConfilictPerfix = 'tree_1' ][, mixed $where = '' ]) : mixed
Parameters
$tablename :

the target table name

$category_id : mixed
$primaryKeyField : string = 'id'

(Target database table primary key (it is usually id))

$titleFieldName : string = 'title'

(Title field of database table that will appears in treeview items)

$parentRelationFieldName : string = 'parent_id'

(The field that is used to create relation between items)

$jqueryNoConfilictPerfix : string = 'tree_1'

(When we have multiple treeview(s) in a single web page we need this prefix to prevent of HTML same id errors )

$where : mixed = ''
Return values
mixed

generate_tree_list()

private generate_tree_list( $array, int $parent, int $i, int $category_id) : string
Parameters
$array :
$parent : int
$i : int
$category_id : int
Return values
string

Search results