Frontend\Core\Engine\TemplateModifiers::profileSetting PHP Method

profileSetting() public static method

Output a profile setting syntax: {{ profilesetting($string, $name) }}
public static profileSetting ( string $string, string $name ) : string
$string string The variable
$name string The name of the setting
return string
    public static function profileSetting($string, $name)
    {
        $profile = FrontendProfilesModel::get((int) $string);
        if ($profile === false) {
            return '';
        }
        // convert into array
        $profile = $profile->toArray();
        // @remark I know this is dirty, but I couldn't find a better way.
        if (in_array($name, array('display_name', 'registered_on', 'full_url')) && isset($profile[$name])) {
            return $profile[$name];
        } elseif (isset($profile['settings'][$name])) {
            return $profile['settings'][$name];
        } else {
            return '';
        }
    }