简体   繁体   中英

difference between CRoute and Jroute in Joomla 3

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));

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>';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM