If you search how to build the logout text link for the Joomla! then you are at the right place now. The answer is below
Logout
Do you need to redirect user to the needed URL after logout? Then you have to add the parameter return=[your-base64-encoded-return-URL]. For example
Logout
where
$returnURL = base64_encode('URL to redirect');
Or if you need to redirect to the site root of your Joomla! installation after logout then you can use this link with preencoded return parameter value
Logout
You can read discussion on this issue at these topics
http://forum.joomla.org/viewtopic.php?f=466&t=325172
http://forum.joomla.org/viewtopic.php?f=428&t=334765
of the Joomla! discussion forum.

