Skip to content

zexperto/magento2-create-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

magento2-create-module

How To use this file

  1. Include the Class File
  2. 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 );

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages