Skip to content

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.