How To use this file
- Include the Class File
- This is an example of how to use this class
// --------------------------------------------------------------
$config_array = [
"observer" => array(
"global"=>array("sales_order_place_after"),
"frontend"=>array("catalog_product_load_after"),
"adminhtml"=>array(),
),
"helper" => true,
"setup" => true,
"block" => false,
"controller" => false,
"model" => false,
"view" => [
"frontend" => false,
"adminhtml" => true
],
// vernder and module name will add as prefix to table, only id and status will create
"backend_model" => [
[
"api" => true,
"name" => "Contact",
"table" => "contacts",
"columns" =>[
array(
"name" =>"full_name",
"label" =>"Full Name",
"type" => "string",
"size" =>"64",
"rquired" =>"true"
),
array(
"name" =>"age",
"label" =>"Age",
"type" => "int",
"rquired" =>"true"
),
array(
"name" =>"birth_date",
"label" =>"Birth Date",
"type" => "date",
'class' => 'validate-date',
"rquired" =>"true"
),
array(
"name" =>"balance",
"label" =>"Balance",
"type" => "decimal",
"rquired" =>"true"
)
]
]
]
];
$mod = new Magento2Module ( "ZEO", "WHH" );
$mod->setConfig ( $config_array );
echo $mod->create ( $config_array );