Skip to content
Permalink
Browse files

2. Register a new controller

  • Loading branch information...
Andresa Martins
Andresa Martins committed Mar 8, 2019
1 parent b2d38a7 commit f64df2bf8b07d8ed220352d4ed2f76534efdbb8d
Showing with 33 additions and 0 deletions.
  1. +25 −0 Acl/Controller/Adminhtml/Index/Index.php
  2. +8 −0 Acl/etc/adminhtml/routes.xml
@@ -0,0 +1,25 @@
<?php
namespace Examples\Acl\Controller\Adminhtml\Index;
use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
class Index extends \Magento\Backend\App\Action
{
protected $resultPageFactory;
public function __construct(
Context $context,
PageFactory $resultPageFactory
)
{
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
echo 'My Backend Controller Works!';
}
}
@@ -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="exampleacl" frontName="exampleacl">
<module name="Examples_Acl" before="Magento_Backend"/>
</route>
</router>
</config>

0 comments on commit f64df2b

Please sign in to comment.
You can’t perform that action at this time.