I tried to follow these tutorials:
-
https://medium.com/@jhonkelly2016/how-to-create-admin-grid-in-magento-2-9f39d052322d
-
https://www.mageplaza.com/magento-2-module-development/create-admin-grid-magento-2.html
But in both cases I ended up with a empty page. Without any grid!
This is my controller path: path/to/vendor/atty31/subscription/Controller/Adminhtml/Subscription/Index.php
.
This is my controller content:
< ?php
namespace Atty31SubscriptionControllerAdminhtmlSubscription;
class Index extends MagentoBackendAppAction
{
protected $resultPageFactory = false;
public function __construct(
MagentoBackendAppActionContext $context,
MagentoFrameworkViewResultPageFactory $resultPageFactory
)
{
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->prepend((__('View Subscriptions')));
return $resultPage;
}
protected function _isAllowed()
{
return $this->_authorization->isAllowed('Atty31_Subscription::subscription_index');
}
}
This is my di.xml
path: path/to/vendor/atty31/subscription/etc/di.xml
and it’s content:
< ?xml version="1.0"?>
atty31_subscription
Atty31SubscriptionModelResourceModelSubscription
- Atty31SubscriptionModelResourceModelSubscriptionCollection
and the layout xml path: /path/to/vendor/atty31/subscription/view/adminhtml/layout/subscription_subscription_index.xml
and it’s content:
< ?xml version="1.0"?>
and finally the ui component file’s path: path/to/vendor/atty31/subscription/view/adminhtml/ui_component/atty31_subscription_grid.xml
and it’s content:
< ?xml version="1.0" encoding="UTF-8"?>
-
- atty31_subscription_grid.atty31_subscription_grid_data_source
- atty31_subscription_grid.atty31_subscription_grid_data_source
- atty31_subscription_columns
-
-
- add
- Add New Blog
- primary
- */*/new
MagentoFrameworkViewElementUiComponentDataProviderDataProvider
atty31_subscription_grid_data_source
id
id
-
- Magento_Ui/js/grid/provider
-
- blog_id
-
- id
-
- text
- asc
- ID
-
- text
- asc
- Customer ID
-
- dateRange
- Magento_Ui/js/grid/columns/date
- date
- Created At
Does anybody give some hints what should i check next? or maybe point me to the mistake that i made ?
Thank you in advance!