Skip to content

Instantly share code, notes, and snippets.

@evercode1
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save evercode1/8f6678efd12440c6366f to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/8f6678efd12440c6366f to your computer and use it in GitHub Desktop.
User Profile Relations Cahp 5
/**
* @getProfileId
*
*/
public function getProfileId()
{
return $this->profile ? $this->profile->id : 'none';
}
/**
* @getProfileLink
*
*/
public function getProfileLink()
{
$url = Url::to(['profile/view', 'id'=>$this->profileId]);
$options = [];
return Html::a($this->profile ? 'profile' : 'none', $url, $options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment