Magento 2 Get Page URL in PHTML file (Template File)

Magento 2 Get Page URL in PHTML file (Template File)

This article help you to get base url in latest magento 2 version.
<?php echo $block->getUrl(‘custom/index/index’); ?>
<?php echo $block->getBaseUrl(); ?>
Magento get Customer Account Url
<?php echo $block->getUrl(‘customer/account’); ?>
Magento get Customer Login URL
<?php echo $block->getUrl(‘customer/account/login’); ?>
Magento get Customer Register URL
<?php echo $block->getUrl(‘customer/account/create’); ?>
Hope this helps. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *