Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
How to create a module in Magento 2.0
(Updated in August 2015)
2
1 THE STRUCTURE OF A SIMPLE MODULE
Magento 1 vs Magento 2
Some new folders in Magento 2
2
CREATE A SIMPLE MODULE IN MAGENT...
MAGENTO 2
Folders and files of a module are put in
only a package and located in app/code
folder
1. THE STRUCTURE OF A SIM...
Some new folders in Magento 2
i18n: store the .csv files for module
translator. Eg: en_US.csv, de_DE.csv
Setup: store the ...
Let’s create folders with the structure as
following:
Namespace: Tutorial
Module name: Example
Example link on Local host:...
Step 1: Create configuration files
1.1. Create file: app/code/Tutorial/Example/etc/module.xml
Purpose: Declare your module...
Step 1: Create configuration files
1.2 Create file:
app/code/Tutorial/Example/etc/frontend/routes.xml
Purpose: Declare the...
Step 2: Create controller, layout and template files
2.1 Create the controller
file: app/code/Tutorial/Example/Controller/...
Step 2: Create controller, layout and template files
2.2 Create the layout file:
app/code/Tutorial/Example/view/frontend/l...
Step 2: Create controller, layout and template files
2.3 Create the template file:
app/code/Tutorial/Example/view/frontend...
Step 3: Activate the module in the configuration file
3.1 Activate module by opening app/etc/config.php file then
add this...
Step 3: Activate the module in the configuration file
3.2 Open the Command in Windows (or the Terminal in Linux
and MAC OS...
Step 3: Activate the module in the configuration file
3.3 Clear the Magento cache then access with
url http://localhost/ma...
Following MageWorld Magento 2 Tutorial Series…
Próxima SlideShare
Cargando en…5
×

How to create a simple module in Magento 2

393 visualizaciones

Publicado el

As you know, the beta version of Magento 2 was released several months ago and after that there are some updates on this beta version as well. With developers, Magento 2.0 is quite challenging because resources to learn are very limited.

Understand such difficulties, MageWorld are happy to introduce you a tutorial series on Magento 2.0. We hope you will enjoy them and make use of it easily!

Let’s get started with the first post: “How to create a simple module in Magento 2.0”

Publicado en: Tecnología
  • Hi Mark, Thanks for sharing such a great article, with the help of slides i am done with module, but for structure i found this one best, https://www.cloudways.com/blog/create-module-in-magento-2/ , your article helped everyone a a lot, hoping to find this 1 best as well.
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí
  • Sé el primero en recomendar esto

How to create a simple module in Magento 2

  1. 1. How to create a module in Magento 2.0 (Updated in August 2015) 2
  2. 2. 1 THE STRUCTURE OF A SIMPLE MODULE Magento 1 vs Magento 2 Some new folders in Magento 2 2 CREATE A SIMPLE MODULE IN MAGENTO 2 Step 1: Create configuration files Step 2: Create controller, layout and template files Step 3: Activate the module in the configuration file OUTLINE
  3. 3. MAGENTO 2 Folders and files of a module are put in only a package and located in app/code folder 1. THE STRUCTURE OF A SIMPLE MODULE MAGENTO 1 Folders and files of a module are located in different folders: app/code/local, app/code/community, app/design, app/etc, app/locale, js, skin,…
  4. 4. Some new folders in Magento 2 i18n: store the .csv files for module translator. Eg: en_US.csv, de_DE.csv Setup: store the files which are used to create tables or insert data to the database. View: This folder stores the layout, template, image, CSS and Javascript files which are used for your module.
  5. 5. Let’s create folders with the structure as following: Namespace: Tutorial Module name: Example Example link on Local host: http://localhost/magento2/exam ple/index/index/ 2. CREATE A SIMPLE MODULE IN MAGENTO 2
  6. 6. Step 1: Create configuration files 1.1. Create file: app/code/Tutorial/Example/etc/module.xml Purpose: Declare your module Source Code: (Go to our blog tutorial for full source code)
  7. 7. Step 1: Create configuration files 1.2 Create file: app/code/Tutorial/Example/etc/frontend/routes.xml Purpose: Declare the router of module for frontend (Go to our blog tutorial for full source code)
  8. 8. Step 2: Create controller, layout and template files 2.1 Create the controller file: app/code/Tutorial/Example/Controller/Index/Index.php => The souce code is found in our blog tutorial
  9. 9. Step 2: Create controller, layout and template files 2.2 Create the layout file: app/code/Tutorial/Example/view/frontend/layout/example_inde x_index.xml (Go to our blog tutorial for full source code)
  10. 10. Step 2: Create controller, layout and template files 2.3 Create the template file: app/code/Tutorial/Example/view/frontend/templates/index.phtml (Go to our blog tutorial for full source code)
  11. 11. Step 3: Activate the module in the configuration file 3.1 Activate module by opening app/etc/config.php file then add this line “'Tutorial_Example' => 1” into it: (Go to our blog tutorial for full source code)
  12. 12. Step 3: Activate the module in the configuration file 3.2 Open the Command in Windows (or the Terminal in Linux and MAC OS). Go to Magento root folder and run this command line to install module: binmagento setup:upgrade (Go to our blog tutorial for full source code)
  13. 13. Step 3: Activate the module in the configuration file 3.3 Clear the Magento cache then access with url http://localhost/magento2/example/index/index/
  14. 14. Following MageWorld Magento 2 Tutorial Series…

×