本文整理汇总了PHP中Dao::getComments方法的典型用法代码示例。如果您正苦于以下问题:PHP Dao::getComments方法的具体用法?PHP Dao::getComments怎么用?PHP Dao::getComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dao
的用法示例。
在下文中一共展示了Dao::getComments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<input type="radio" name="vote" value="anti" id="anti" /><img class="antilabel" src="images/thumbs_down.png" />
</label>
<label class="neutrallabel">
<input type="radio" name="vote" value="neutral" id="neutral" checked="checked" />?</label>
<input type="submit" name="commentButton" value="Submit" />
<input type="hidden" name="form" value="comment" />
<input type="hidden" name="bill" value="<?php
echo $bill["bill_id"];
?>
" />
</form>
</div>
<div class="pro"><h3>Yea</h3>
<?php
$comments = $dao->getComments($bill["bill_id"], "pro");
foreach ($comments as $comment) {
?>
<span><?php
echo $comment["username"];
?>
says:</span> <?php
echo $comment["comment"] . "<br />";
echo "DATE:" . $comment["date"] . "<br />";
?>
<?php
}
?>
</div>
示例2: Dao
<div class="comments">
<h2>Comments</h2>
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/Dao.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/User.php";
$dao = new Dao();
$usr = new User();
$comments = $dao->getComments($post_id);
foreach ($comments as $comment) {
$user = $dao->getUserById($comment["user_id"]);
echo "<div class='regular p2 bg-light-gray m2 rounded'>";
echo htmlspecialchars($comment["content"]);
echo "</div>";
echo "<div class='bold'>";
echo htmlspecialchars($usr->user_name($user));
echo "</div>";
}
?>
</div>