API16

JUserHelper/getProfile: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Gets the user profile information <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
Gets the user profile information  
Gets the user profile information  


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JUserHelper/getProfile|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JUserHelper/getProfile}}
 
 


===Syntax===
===Syntax===
Line 52: Line 50:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JUserHelper/getProfile|Edit See Also]]<nowiki>]</nowiki>
 
</span>
{{SeeAlso:JUserHelper/getProfile}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getProfile
  category=getProfile
  category=JUserHelper
  category=JUserHelper
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>

Latest revision as of 02:16, 25 March 2017

Description

Gets the user profile information



Syntax

getProfile($userId=0)
Parameter Name Default Value Description
$userId 0

Defined in

libraries/joomla/user/helper.php

Importing

jimport( 'joomla.user.helper' );

Source Body

function getProfile($userId = 0)
{
        if ($userId == 0) {
                $user   = & JFactory::getUser();
                $userId = $user->id;
        }
        else {
                $user   = & JFactory::getUser((int) $userId);
        }

        // Get the dispatcher and load the users plugins.
        $dispatcher     = &JDispatcher::getInstance();
        JPluginHelper::importPlugin('users');

        $data = new JObject;

        // Trigger the data preparation event.
        $results = $dispatcher->trigger('onPrepareUserProfileData', array($userId, &$data));

        return $data;
}



Examples

Code Examples