对用户objectId的解析查询显示为空白?

时间:2019-05-01 01:03:38

标签: php parse-platform

我试图获取用户objectId以便我可以将链接附加到图像。 当我尝试使用

href="other-user-profile.php?userID='$user->get('objectId')'"
在鼠标悬停时,

上显示mywebsite.com/user-profile&userID= 香港专业教育学院尝试过的

<?php
$nearDeliveries = $items->getNearDeliveries();
foreach ($nearDeliveries as $user):
$avatarUrl = 'images/default.jpg';
if ($user->get('avatar')) {
    $avatarUrl = $user->get('avatar')->getURL();
}
$stars = '';
for ($i = 0; $i < (int)$user->rating; $i++) {
    $stars .= '<img src="images/leaf-star.png" class="rate-star"  />';
}

echo '<li class="product-box">
    <div class="item-box">
    <a href="other-user-profile.php?userID='$user->get('objectId')'">
        <img src="' . $avatarUrl . '" class="product-image" />
     </div>
    <strong>' . $user->get('username') . '</strong>

    <span>
          <span>' . $stars . '</span>
  </span>
</li>';
endforeach;
?>

1 个答案:

答案 0 :(得分:0)

<a href="other-user-profile.php?userID='.$user->getObjectId().'">