Magento 2: How to get only the file name of Home Page Logo?
-
13-04-2021 - |
Question
is there a way to only get the filename of an Homepage logo in the logo.phtml template file? $block->getLogoSrc() in logo.phtml returns the URL to the logo, but I need only the filename like someimage.jpeg.
Solution
Just use the basename function <?= basename($block->getLogoSrc()) ?>
to get the filename.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange