Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I need to get the path of the current page like - /customer/account/ NOT http://magento.dev/customer/account/index/
Any idea how to do it?
$this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
Within a block, you should be able to use...
<?php echo $block->getRequest()->getRequestUri() ?>
...to return just the path portion of the full current page URL.
Required, but never shown
2 years, 3 months ago
1 year, 5 months ago