difference between CRoute and Jroute in Joomla 3

243 views Asked by At

what difference between CRoute and Jroute in Joomla 3.

$mainframe = JFactory::getApplication();

I have $mainframe->redirect(CRoute::_('index.php?option=com_community&view=register&task=registerProfileType', false)); this redirect, and it dosent work , with 303 See other Error, but when I change my code to $mainframe->redirect(JRoute::_('index.php?option=com_community&view=register&task=registerProfileType', false));

1

There are 1 answers

0
Francisco Caviano On

From the JoomSocial Wiki:

By using our own library, CRoute, which is a replacement for JRoute, the link to any part of JomSocial will have the correct Itemid and will help avoid any duplicate links.

Are you using that redirect link where? Are you sure the JomSocial libraries are loaded there?

From the example, you should include the library:

include_once JPATH_ROOT.'/components/com_community/libraries/core.php';

Then use the object:

// Get CUser object
$link = CRoute::_('index.php?option=com_community&view=profile&userid='.$userid);
echo '<a href="/.$link." mce_href="http://www.jomsocial.com/.$link.">View user profile</a>';