I am making a dashboard for user's home page for social engine, so areas are clear For example - messages, settings etc
I want to have button saying "view profile" but how can I href this link so it pulls in user's id?
I've tried href the whole link upto /profile and adding php echo $engine4_users->user_id; etc
I also tried this in html clock, to make a button, but still it isn't working
<?php
$viewer = Engine_Api::_()->user()->getViewer();
?>
<a href="profile/<?php echo Engine_Api::_()->user()->getViewer()->user_id;?>;">View Profile</a>
I just want to make my own button link for all members that goes to that user's profile.
php dont work in .html file so no php code will execute in html block. Please create a module's widget.
To get URL of user's profile:
$href = $viewer->getHref();
To construct the link in template (view):
echo $this->htmlLink($viewer->getHref(), "View Profile");