I got a code like this in my controller
class MyController extends MyBaseController {
function redirectToCart() {
$link = JRoute::_('index.php?option=com_foo&view=cart');
$this->setRedirect($link);
}
}
I also created a menu associated with my view cart in menu name "View Cart" every time i click this button the url is domainname.com/view-cart
but when use redirect in mvc the url is domainname.com/index.php?option=com_foo&view=cart
How can i create a redirect in mvc that it work with the front-end link or at least create a user friendly url