I'm new in Magento2 and I want to know the detail of controller_action_postdispatch events like controller Name, action name,module name and all the details related to that event. I have created an events.xml file where I called the event name then try to get the details from the observer. My question is how to get the details on that event? I have found $this->_request->getControllerModule(); but I couldn't use \Magento\Framework\App\Request\Http $request in observer.
Is there any
Here is my events.xml code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="controller_action_postdispatch">
<observer name="category" instance="Comlitix\ComlitixInfo\Observer\Category"/>
</event>
</config>
Here is observer file
<?php
namespace Comlitix\ComlitixInfo\Observer;
use Magento\Framework\Event\Manager;
class Category implements \Magento\Framework\Event\ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
echo'Hello world';
die;
}
}