I have created a custom module in which I want to check if a (image)file exists in my view/frontend/web/images
folder.
I have checked this answer but in only shows how to get Magento's directory paths.
How can I get full path for my module's directory which will support with Magento 2's static content deploy feature?
EDIT
As per Rakesh's answer I can use below code.
$mediapath = $this->_filesystem->getDirectoryRead(DirectoryList::APP)->getAbsolutePath();
$modulePath = echo $mediapath.'code/Packagename/Modulename/view/frontend/web/images';
Is there any other alternative to this approach?
Best Answer
Use code below to get module directory path
but if you need to check content static file I'd recommend you to use this way...