Your syntax isn't correct, try something like:
$aliasValues = Engine_Api::_()->fields()->getFieldsValuesByAlias($mam_user);
echo $aliasValues['profile_type']; // just for example
Question
I am creating a widget to show most active viewers but want to also fetch a custom field by alias. I have the below in my .tpl:
<ul>
<?php foreach( $this->paginator as $mam_user ): ?>
<div>
<?php echo $this->htmlLink($mam_user->getHref(), $this->itemPhoto($mam_user, 'thumb.icon'), array('class' => 'popularmembers_thumb')) ?>
<h3>
<?php echo $this->htmlLink($mam_user->getHref(), $mam_user->getTitle()) ?>
</h3>
<?php
// Fetches Fields from database by Alias
$tagline = Engine_Api::_()->fields()->getFieldsValuesByAlias();
echo $this->$mam_user->$tagline['tagline'];
?>
</div>
<?php endforeach; ?>
I controller file is the same as that of the "Popular members" untouched.. but something seem not working here. I guess i'm doing something wrongly here. Any help pls..; and thanks in advance.
Solution
Your syntax isn't correct, try something like:
$aliasValues = Engine_Api::_()->fields()->getFieldsValuesByAlias($mam_user);
echo $aliasValues['profile_type']; // just for example