{"id":2105,"date":"2020-10-09T05:31:41","date_gmt":"2020-10-09T05:31:41","guid":{"rendered":"https:\/\/www.cynoinfotech.com\/?p=2105"},"modified":"2026-04-16T13:32:11","modified_gmt":"2026-04-16T13:32:11","slug":"what-is-module-in-magento-2","status":"publish","type":"post","link":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/","title":{"rendered":"What is Module in Magento 2"},"content":{"rendered":"<p>The module is an independent component. It is logical to the group &#8211; that contains blocks, controllers, helpers, models, etc &#8211; that are related to a specific business feature. It allows bringing additional features for the e-commerce store which is based on Magento 2.<\/p>\n<p><strong>Module are two locations where a module can be located in Magento 2<\/strong><\/p>\n<p>An <em>app\/code<\/em> directory is the first location. This directory used for all custom and 3rd party modules.<\/p>\n<p>A <em>vendor<\/em>\u00a0directory is the second location. If you build an extension to be reused, it is better to use the composer to create it and put your module in this folder.<\/p>\n<p>Let&#8217;s create a vendor directory inside the <em>app\/code\/Vendor\/<\/em> directory, let&#8217;s create a module directory.<\/p>\n<p>There are two required files: <strong>registration.php<\/strong> and <strong>module.xml<\/strong><\/p>\n<p>&#8211; The <strong>registration.php<\/strong> file inside the <em>app\/code\/Vendor\/Module<\/em> with the following code.<\/p>\n<pre class=\"toolbar:1 lang:php decode:true\">&lt;?php\r\n\r\nuse Magento\\Framework\\Component\\ComponentRegistrar;\r\n\r\nComponentRegistrar::register(\r\n\tComponentRegistrar::MODULE,\r\n\t'Vendor_Module',\r\n\t__DIR__\r\n);<\/pre>\n<p>&#8211; The <strong>module.xml<\/strong> file inside the <em>app\/code\/Vendor\/Module\/etc<\/em> with the following code.<\/p>\n<pre class=\"toolbar:1 lang:xhtml decode:true \">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\r\n\t&lt;module name=\"Vendor_Module\"\/&gt;\r\n&lt;\/config&gt;<\/pre>\n<p><strong>How to register a Module?<\/strong><\/p>\n<p>Now, the last step is run the command which will enable and install the <strong>Vendor_Module<\/strong> module.<\/p>\n<p>php bin\/magento setup:upgrade<\/p>\n<p>Module has been added and enabled in a Magento 2 application. You can check in <strong>app\/etc\/config.php<\/strong> file.<br \/>\nThe value <strong>1<\/strong> means the module is enabled, and <strong>0<\/strong> that means the module is disabled. If <strong>Vendor_Module<\/strong> the module is set to <strong>1<\/strong>, which means that the module has been successfully registered in a Magento 2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The module is an independent component. It is logical to the group &#8211; that contains blocks, controllers, helpers, models, etc &#8211; that are related to a specific business feature. It allows bringing additional features for the e-commerce store which is based on Magento 2. Module are two locations where a module can be located in [&hellip;]<\/p>\n","protected":false},"author":270,"featured_media":2115,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-blog"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is Module in Magento 2 - cynoinfotech<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/\"},\"author\":{\"name\":\"Payal Patel\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/d60abb6a6e9a42b790821bb0f2e6d92e\"},\"headline\":\"What is Module in Magento 2\",\"datePublished\":\"2020-10-09T05:31:41+00:00\",\"dateModified\":\"2026-04-16T13:32:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/\"},\"wordCount\":249,\"publisher\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/what-is-module-magento2.jpg\",\"articleSection\":[\"Magento blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/\",\"name\":\"What is Module in Magento 2 - cynoinfotech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/what-is-module-magento2.jpg\",\"datePublished\":\"2020-10-09T05:31:41+00:00\",\"dateModified\":\"2026-04-16T13:32:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/what-is-module-magento2.jpg\",\"contentUrl\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/what-is-module-magento2.jpg\",\"width\":895,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/what-is-module-in-magento-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is Module in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\",\"name\":\"cynoinfotech\",\"description\":\"web design &amp; development\",\"publisher\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#organization\",\"name\":\"Cynoinfotech\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cynoinfotech.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/final-logo-ci.png\",\"contentUrl\":\"https:\\\/\\\/www.cynoinfotech.com\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/final-logo-ci.png\",\"width\":240,\"height\":70,\"caption\":\"Cynoinfotech\"},\"image\":{\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/cynoinfotech\\\/\",\"https:\\\/\\\/x.com\\\/cynoinfotech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/#\\\/schema\\\/person\\\/d60abb6a6e9a42b790821bb0f2e6d92e\",\"name\":\"Payal Patel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g\",\"caption\":\"Payal Patel\"},\"description\":\"Payal is Sr. Magento2 Full Stack Developer who writes clean code and follows best practices. She is always ready for learning new things.\",\"url\":\"https:\\\/\\\/cynoinfotech.com\\\/blog\\\/author\\\/pr-patel4819\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Module in Magento 2 - cynoinfotech","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/"},"author":{"name":"Payal Patel","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/person\/d60abb6a6e9a42b790821bb0f2e6d92e"},"headline":"What is Module in Magento 2","datePublished":"2020-10-09T05:31:41+00:00","dateModified":"2026-04-16T13:32:11+00:00","mainEntityOfPage":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/"},"wordCount":249,"publisher":{"@id":"https:\/\/cynoinfotech.com\/blog\/#organization"},"image":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cynoinfotech.com\/blog\/wp-content\/uploads\/2020\/10\/what-is-module-magento2.jpg","articleSection":["Magento blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/","url":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/","name":"What is Module in Magento 2 - cynoinfotech","isPartOf":{"@id":"https:\/\/cynoinfotech.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/cynoinfotech.com\/blog\/wp-content\/uploads\/2020\/10\/what-is-module-magento2.jpg","datePublished":"2020-10-09T05:31:41+00:00","dateModified":"2026-04-16T13:32:11+00:00","breadcrumb":{"@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#primaryimage","url":"https:\/\/cynoinfotech.com\/blog\/wp-content\/uploads\/2020\/10\/what-is-module-magento2.jpg","contentUrl":"https:\/\/cynoinfotech.com\/blog\/wp-content\/uploads\/2020\/10\/what-is-module-magento2.jpg","width":895,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/cynoinfotech.com\/blog\/what-is-module-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cynoinfotech.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is Module in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/cynoinfotech.com\/blog\/#website","url":"https:\/\/cynoinfotech.com\/blog\/","name":"cynoinfotech","description":"web design &amp; development","publisher":{"@id":"https:\/\/cynoinfotech.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cynoinfotech.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cynoinfotech.com\/blog\/#organization","name":"Cynoinfotech","url":"https:\/\/cynoinfotech.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.cynoinfotech.com\/wp-content\/uploads\/2017\/11\/final-logo-ci.png","contentUrl":"https:\/\/www.cynoinfotech.com\/wp-content\/uploads\/2017\/11\/final-logo-ci.png","width":240,"height":70,"caption":"Cynoinfotech"},"image":{"@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/cynoinfotech\/","https:\/\/x.com\/cynoinfotech"]},{"@type":"Person","@id":"https:\/\/cynoinfotech.com\/blog\/#\/schema\/person\/d60abb6a6e9a42b790821bb0f2e6d92e","name":"Payal Patel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/50363130ecc9094fa930ca04cf1a31f712dc885f4c4e807a0a2fe2fb3ba14674?s=96&d=mm&r=g","caption":"Payal Patel"},"description":"Payal is Sr. Magento2 Full Stack Developer who writes clean code and follows best practices. She is always ready for learning new things.","url":"https:\/\/cynoinfotech.com\/blog\/author\/pr-patel4819\/"}]}},"_links":{"self":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/2105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/users\/270"}],"replies":[{"embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=2105"}],"version-history":[{"count":8,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/2105\/revisions"}],"predecessor-version":[{"id":3313,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/2105\/revisions\/3313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/media\/2115"}],"wp:attachment":[{"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=2105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=2105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cynoinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=2105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}