• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

$user contains Custom Fields?

Marcus

Well-known member
#1
I want to rewrite stock avatars depending on custom user fields. I located protected static function _getDefaultAvatarUrl(array $user, $size) in Template/Helper/core.php and want to use the $user variable to check against checkbox custom user field "favoritemeal" which can be "potato", "pizza", "pasta" ... Do you know how to fetch the custom user field "favoritemeal" from $user?

Many thanks!
 

dmnkhhn

Active member
#2
In that very file there is this:
PHP:
public static function helperUserFieldValue($field, array $user = array(), $fieldValue = null)
It's normally used as a viewHelper in the template but I suppose you can use it for your own purpose. :)