Access the custom fields in joomla 3

Viewed 2312

In joomla 3 you can add custom fields. They are saved in the joomla mysql database under "_fields".

I´ve created a new custom field called "region". The users can add a value in their profile settings. So my question is now, how can i call the users value of this custom field via php?

I know how to call the users profile values for example:

jimport( 'joomla.user.helper' );
$user = JFactory::getUser();
$userId = $user->id;
$userProfile = JUserHelper::getProfile( $userId );
$usercity = $userProfile->profile['city'];

So how can I call the _field values?

2 Answers
Related