Working with backend components
The Magento backend exists with a lot of reusable components, such as a button, menus, forms, and more. When creating backend extensions, you can use these components to build you custom pages. In this recipe, we will create a page where we can play with the components available .
Getting ready
We will extend the existing Packt_HelloWorld
module with a new page where we can play with the backend components.
How to do it...
In the following steps, we will create a page that uses some backend components:
We will make some tests in a new controller action. Create a file
app/code/Packt/HelloWorld/Controller/Adminhtml/Component/Index.php
with the following content:<?php namespace Packt\HelloWorld\Controller\Adminhtml\Component; 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, ...