Skip to content

Deprecated since 7.2

This page documents the classic module layer (CBController and cbInit()). It still works in every 7.x release, but new code should use resources and pages.

Use instead: A child resource with SelectFilter::relationship(), linked from the parent with Column::url().

How To Make A Graded Module (Parent Module -> Sub Module -> Sub Module) ​

Albums Table ​

Field NameData Type
idint(PK)
created_attimestamp
namevarchar(255)
descriptionvarchar(255)

Photos Table ​

Field NameData Type
idint(PK)
created_attimestamp
namevarchar(255)
photovarchar(255)
albums_idint(11)

Code ​

php
$this->sub_module[] = ['label'=>'Photos','path'=>'photos','parent_columns'=>'name,description','foreign_key'=>'albums_id','button_color'=>'success','button_icon'=>'fa fa-bars'];

image

Legend ​

Attribute NameDescription
labelSpecify the label of sub module
pathSpecify the module path (slug)
parent_columnsSpecify the parent fields in this case Album Fields that you want to show. Sparate it with comma
parent_columns_aliasSpecify the parent field alias. Sparate it with comma
foreign_keySpecify the Foreign Key Field of photos table
button_colorSpecify the color of button (primary,warning,success,info)
button_iconSpecify the icon. You can find out at Font Awesome
custom_parent_idSpecify the id field.

What's Next ​

Table Of Contents ​

Released under the MIT License.