I'm using the HybridAuth library to display a list of user contacts from Gmail. The object member is displayName and I'm using it like this:
{foreach from=$contacts key=k item=contact}
<span class="name">{$contact->displayName}</span>
{/foreach}
I'd like to use it like this:
{foreach from=$contacts key=k item=contact}
<span class="first-name">{$contact-firstName}</span>
<span class="last-name">{$contact->lastName}</span>
{/foreach}
I imagine I could do this with regex without much trouble but I know regex is not the preferred solution. I've been trying to figure out something like..
{$contact->strtok(displayName," ")}
which returns
Fatal error : Call to undefined method Hybrid_User_Contact::strtok()
I'm now trying to do something like this..
{assign var=$contact value=" "|explode:displayName}
but I haven't figured out how to do it correctly yet.