echo 'Joomla base URI is ' . JURI::base() . "\n";
echo 'Joomla base URI (path only) is ' . JURI::base( true ) . "\n";

Output:

Joomla base URI is http://localhost/joomla/
Joomla base URI (path only) is /joomla

Path for a view in joomla:

 echo JRoute::_('index.php?option=com_comname&view=viewname');

Advertisements