Question: I have just created a custom attribute for categories through Attribute Manager, with attribute code `category_view_img`.

Now I can only put one image into a category, and use this image for both the banner and category-view-image on the home page. I want to use this custom attribute image on the home page as category view image. How can I get this image on front-end?

I am new to Magento and I don't have ideas how to do this, please assist. I am using Magento 1.9.2.3.

Answer: 
You can still do that in M2.

`$this->_getModuleName()` would still work, provided your helper class extends `\Magento\Framework\App\Helper\AbstractHelper` (which most of the time it should, anyway).

PS: As for fetching the module name in observers, that's a different story. One which needs more details. Or another question even. Do you want to get the module of *the current observer*? You could implement something similar to what `\Magento\Framework\App\Helper\AbstractHelper::_getModuleName()` does.
```
public function __construct (
     ....
     \Magento\Framework\App\Request\Http $request,
     ....
) {   
     ....
     $this->_request = $request;
     ....
}

```

To get module name :

```
public function getModuleName()
{
     return $this->_request->getModuleName();
}

```