In template I try to get url link but it doesn't work correct. I try to use this code:
$block->getUrl('aloha/product/view/id/')
But it always return http://abcs.com/aloha/product/view/, Is this a bug?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIn template I try to get url link but it doesn't work correct. I try to use this code:
$block->getUrl('aloha/product/view/id/')
But it always return http://abcs.com/aloha/product/view/, Is this a bug?
$block->getUrl('aloha/product/view/id/')
This is the wrong approach. Try following way:
$block->getUrl('aloha/product/view', ['id' => 22])
[Update]
According to your comment you need url using id. GetUrl will return route/contoller/actionclass and ignore remaining string. In your case, try following way:
$block->getUrl('aloha/product/view').'/id'