5.3建立最近评论导航
此节,建立最后一个导航,显示最近发表的评论列表。
5.3.1建立RecentComments类
建立RecentComments类文件:
[img]http://dl.iteye.com/upload/attachment/316274/5bb2fae8-4252-3161-b3ed-728f580d3358.jpg[/img]
上文调用了建立在Comment类中的findRecentComments方法
[img]http://dl.iteye.com/upload/attachment/316276/160bc163-96f1-326e-837c-8898541da4dc.jpg[/img]
5.3.2建立recentComments视图
recentComments视图保存在组件文件夹中。视图很方便的呈现出RecentComments::getRecentComments方法返回的每条评论。
5.3.3使用RecentComments导航
修改colum2.php
[img]http://dl.iteye.com/upload/attachment/316282/8b7d693d-4ea5-3df8-bcc8-a47ea947a43f.jpg[/img]
此节,建立最后一个导航,显示最近发表的评论列表。
5.3.1建立RecentComments类
建立RecentComments类文件:
[img]http://dl.iteye.com/upload/attachment/316274/5bb2fae8-4252-3161-b3ed-728f580d3358.jpg[/img]
上文调用了建立在Comment类中的findRecentComments方法
[img]http://dl.iteye.com/upload/attachment/316276/160bc163-96f1-326e-837c-8898541da4dc.jpg[/img]
5.3.2建立recentComments视图
recentComments视图保存在组件文件夹中。视图很方便的呈现出RecentComments::getRecentComments方法返回的每条评论。
5.3.3使用RecentComments导航
修改colum2.php
[img]http://dl.iteye.com/upload/attachment/316282/8b7d693d-4ea5-3df8-bcc8-a47ea947a43f.jpg[/img]