Skip to content

Commit

Permalink
Creacion de Modulo
Browse files Browse the repository at this point in the history
 1.- Creacion y activacion de modulo
 2.- creamos nuestro modulo dentro de app/code/VENDOR/NOMBRE_MODULO
     app/code/Learning/FirstUnit
 3.- Creamos nuestro archivo module.xml para especificar el nombre y la version del modulo
     en este archivo podemos especificar si nuestro modulo depende de otro modulo
     este ejemplo en concreto nuestro modulo depende directamente de Magento_catalog
 4.- Creamos nuestro archivo registration.php para indicarle a magento en donde puede econtrar nuestro modulo
     en este caso VENDOR_MODULO = Learning_FirstUnit
 5.- Actualizamos la BD para agergar nuestro modulo y activarlo
 6.- Para verificar si nuestro modulo esta activo , requerimos consultar el archivo app/etc/config.php
      'Learning_FirstUnit' => 1, el (1) indica activo y el (0) desactivado
 7.- Podemos realizar la verificacion desde la CLI con
    grep Learning_FirstUnit app/etc/config.php
=========================== PASOS OPCIONALES ==========================

 8.- SI AUN NO SE ACTIVA : php bin/magento module:enable Learning_HelloPage
 9.- php bin/magento setup:upgrade
 10.- Recompilamos  php bin/magento setup:di:compile
 11.- Asignamos permisos (Pendiente revisar permisos adecuados)
              chmod -R 777 var/ pub/
  • Loading branch information
PerezContrerasLuis committed Jan 16, 2022
1 parent ed92f00 commit 7c3a945
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions code/Learning/FirstUnit/etc/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
14 changes: 14 additions & 0 deletions code/Learning/FirstUnit/registration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* this file tells Magento how to locate the module
*/

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(
ComponentRegistrar::MODULE,
'Learning_FirstUnit',
__DIR__
);
1 change: 1 addition & 0 deletions etc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
'Klarna_Ordermanagement' => 1,
'Klarna_Onsitemessaging' => 1,
'Klarna_Kp' => 1,
'Learning_FirstUnit' => 1,
'Learning_HelloPage' => 1,
'Luisdev_Helloworld' => 1,
'PayPal_Braintree' => 1,
Expand Down

0 comments on commit 7c3a945

Please sign in to comment.