-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creación de menu en barra de menus ADMIN magento2: 1.- Creamos nuestro archivo de configuración para nuestro modulo : app/code/Pfay/Contacts/etc/adminhtml/menu.xml 2.- Creámoos nuestro archivo ruta para el nuevo modulo (menu | enlace ) app/code/Pfay/Contacts/etc/adminhtml/routes.xml 3.- Creamos nuestro controlador app/code/Pfay/Contacts/Controller/Adminhtml/Test/Index.php 4.- Actualizamos, recompilamos y damos permisos php bin/magento setup:upgrade php bin/magento setup:di:compile +------------------------------+ | chown www-data:www-data -R . | <------- OPCIONAL +------------------------------+ chmod -R 777 var/ pub/
- Loading branch information
1 parent
67e5801
commit b945677
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
namespace Pfay\Contacts\Controller\Adminhtml\Test; | ||
use Magento\Backend\App\Action; | ||
|
||
class Index extends \Magento\Backend\App\Action | ||
{ | ||
public function execute() | ||
{ | ||
die('test admin view'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> | ||
<menu> | ||
<add id="Pfay_Contacts" title="Pierre FAY Contacts" module="Pfay_Contacts" sortOrder="20" dependsOnModule="Pfay_Contacts" resource="Pfay_Contacts::contacts"/> | ||
<add id="Pfay_Contacts::index" title="Pierre FAY Contacts" module="Pfay_Contacts" action="contacts/test/index" parent="Pfay_Contacts" sortOrder="20" dependsOnModule="Pfay_Contacts" resource="Pfay_Contacts::contacts"/> | ||
</menu> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:App/etc/routes.xsd"> | ||
<router id="admin"> | ||
<route id="contacts" frontName="contacts"> | ||
<module name="Pfay_Contacts" /> | ||
</route> | ||
</router> | ||
</config> |