Search code examples
phpmysqljoomlajoomla1.5joomla-extensions

Passing a value from my Joomla module to a article


I am on Joomla 1.5 and I am trying to pass the username value of my login module, that shows as a greeting anytime a user is logged in, to a article so i'll be able to customize the article to the user's profile. What would be the best way to do this? thanks


Solution

  • The simplest method is to use Joomla's User Object.

    Like :

    $user = &JFactory::getUser();
    
    echo $user->name;//You will get name,username,email etc .using same object
    

    In the article section just use above line. in components/com_content/view/article/default.php or any other view you want.

    The user object will return the current logged user info.

    hope this will help you..