Properties

$model

$model : string

Type

string — This is the model associated to the controller.

$main_title

$main_title : string

Type

string — This is the title for layout view.

$main_tip

$main_tip : string

Type

string — This is the tip for layout view.

$icon

$icon : string

Type

string — This is the icon for layout view.

$version

$version : string

Type

string — This is the version for layout view.

$create_view

$create_view : string

Type

string — This is the create view associated to the section.

$edit_view

$edit_view : string

Type

string — This is the edit view associated to the section.

$delete_view

$delete_view : string

Type

string — This is the delete view associated to the section.

$delete_title

$delete_title : string

Type

string — This is the delete title section.

$delete_msg

$delete_msg : string

Type

string — This is the delete message to the section.

$create_title

$create_title : string

Type

string — This is the create message to the section.

$edit_title

$edit_title : string

Type

string — This is the edit message to the section.

$breadcum

$breadcum : string

Type

string — This is the breadcrum element to the section.

$pre_breadcum

$pre_breadcum : string

Type

string — This is the previos breadcrum to the section.

Methods

__construct()

__construct() 

Constructor

_set_rules()

_set_rules(array  $items = array()) 

Set form validation

Parameters

array $items

Multidimensional array containing form elements information

_move_not_overwrite()

_move_not_overwrite(string  $source_file, string  $target_dir) 

Move upload file

Parameters

string $source_file

Source file

string $target_dir

Target

_get_data()

_get_data(array  $items = array()) : array

Parse POST data

Parameters

array $items

Multidimensional array containing form elements information

Returns

array

_get_item_data()

_get_item_data(array  $item) : array

Parse POST data

Parameters

array $item

Array containing form element information

Returns

array

_delete_msg()

_delete_msg(array  $data) : array

Adding dynamic data from private vars to inject into the view for section delete of the crud

Parameters

array $data

Array for inject into layout

Returns

array

_create_msg()

_create_msg(array  $data) : array

Adding dynamic data from private vars to inject into the view for section create of the crud

Parameters

array $data

Array for inject into layout

Returns

array

_edit_msg()

_edit_msg(array  $data) : array

Adding dynamic data from private vars to inject into the view for section edit of the crud

Parameters

array $data

Array for inject into layout

Returns

array

_get_fields()

_get_fields(array  $items = array(), null|array  $values = NULL, true|false  $view_only = FALSE) : array

Adding views to make form for sections create/edit/show of the crud

Parameters

array $items

Multidimensional array containing form elements information

null|array $values

Saved values for edit or show, null for create

true|false $view_only

Flag for show view

Returns

array

create()

create() 

Return layout view for create section of crud.

edit()

edit(integer  $id) 

Return layout view for edit section of crud.

Parameters

integer $id

ID

_edit()

_edit(string  $id, string  $back = '', string  $target = '', string  $ok = NULL) : mixed

Help edit method to return layout view for edit section of crud or to process submit for edit section.

Parameters

string $id

Primary key value

string $back

Segment url passed to base_url helper used to back when click on cancel button on delete section

string $target

Segment url passed to base_url helper used to go when click on submit button on delete section

string $ok

-

Returns

mixed

delete()

delete(integer  $id) 

Return layout view for delete section of crud.

Parameters

integer $id

ID

_delete()

_delete(string  $id, string  $back = '', string  $target = '', string  $ok = NULL, true|false  $wrap = TRUE) : mixed

Help delete method to return layout view for delete section of crud or to process submit for delete section.

Parameters

string $id

Primary key value

string $back

Segment url passed to base_url helper used to back when click on cancel button on delete section

string $target

Segment url passed to base_url helper used to go when click on submit button on delete section

string $ok

-

true|false $wrap

-

Returns

mixed

add_breadcum()

add_breadcum(string  $url, string  $text) 

Append new element to private var breadcum.

Parameters

string $url

Segment url passed to base_url helper

string $text

Label for link

add_pre_breadcum()

add_pre_breadcum(string  $url, string  $text) 

Append new element to private var pre_breadcum.

Parameters

string $url

Segment url passed to base_url helper

string $text

Label for link

show_template()

show_template(string  $view, null|array  $data = NULL, string  $template = 'templates/main') 

Load view into template with all dynamic data

Parameters

string $view

View route

null|array $data

Dynamic data to inject into layout & view

string $template

Layout route

_table()

_table(string  $toolbar = '', string  $items_key = 'table') 

Load crud table view

Parameters

string $toolbar

HTML buttons to inject on toolbar box

string $items_key

Key to read off config

_tree()

_tree(null|array  $content = NULL) 

Load tree view

Parameters

null|array $content

Content of tree

table()

table() 

Get JSON with table data

_get_items()

_get_items(string  $config) 

Load items for table or forms of the crud from config files

Parameters

string $config

Route of config to load

_ajax_table()

_ajax_table(string  $items_key = 'table') 

Return JSON to table crud

Parameters

string $items_key

Key to read off config

_callback_filter()

_callback_filter() 

This callback runs on query for table of the crud.

Use to add where clause on the query

_callback_row()

_callback_row(string  $key, mixed  $value, array  $row) : string

This callback runs on each row. It escapes the auto column value and runs the callback.

For this callback the return value is required and must be a string.

Parameters

string $key

Name of column

mixed $value

Value

array $row

Array containing all row data

Returns

string

index()

index() 

Show view tree template

tree_source()

tree_source() 

Return JSON with elements for tree

tree_panel()

tree_panel(integer  $id = NULL) 

Show proper view to rigth side on tree view

Parameters

integer $id

ID

_panel_welcome()

_panel_welcome() 

View to rigth side on tree view, Shows when ID is null

_panel_root()

_panel_root() 

View to rigth side on tree view, Shows when ID is root

_panel_category()

_panel_category(integer  $id) 

View to rigth side on tree view, Shows when ID contain c_ string

Parameters

integer $id

ID

_panel_document()

_panel_document(integer  $id) 

View to rigth side on tree view, Shows when ID contain d_ string

Parameters

integer $id

ID

_create()

_create(string  $back = '', string  $target = '', string  $ok = NULL) : mixed

Help create method to return layout view for create section of crud or to process submit for create section.

Parameters

string $back

Segment url passed to base_url helper used to back when click on cancel button on delete section

string $target

Segment url passed to base_url helper used to go when click on submit button on delete section

string $ok

-

Returns

mixed

get_breadcum()

get_breadcum() : array

Get breadcrum dynamic array to inject into the view

Returns

array

get_menu()

get_menu() : array

Get menu dynamic array to inject into the view

Returns

array