来源:http://trac.seagullproject.org/wiki/Modules/Comment2

Comment2模块

  • requires >= Seagull 0.6.5

概述

comment2模块是为现有的任意模块添加评论功能的快捷方式。

它对现有的comment模块做了很多改进,包括

  • 使用jquery实现ajax,所有就不用在页面之间跳来跳去
  • Ajax提交和查看列表速度很快,使得评论更具交互性

这个模块也包含了一个www目录来存放web资源,如css,javascript和图片,说明集成这个到你的模块是多么容易。

使用

这个模块说明在seagull中使用jquery是很容易。安装了这个模块后,你会在导航栏上发现一个“comment”菜单项,它会调用模块的示例的manager. The best way to follow the full Ajax workflow is, using the Zend debugger:

 1. 在Firefox浏览器中进入到comment界面
 2. 使用zend debug工具栏,选择"next page"
 3. 写一个新的评论,并提交 

这会启动一个交互式调试会话,这样你可以跟随javascript调用的工作流程。

更进一步

Ajax还用到了SGL_AjaxProvider2。SGL_AjaxProvider2将会在Seagull 0.9.x版本中发布,主要特点有:

  • $input和$output对象在每个action方法中都可以使用
  • 使用jquery作为javascript库,它比prototype/scriptaculous要更加简洁强大。
  • 改进了向浏览器传回JSON格式数据的功能
  • SGL_AjaxProvider已经提供了一raiseMsg() 方法,这样就可以比较容易的向用户发送错误/警告/信息
 
modules/comment2.txt · 最后更改: 2010/05/30 00:21 (外部编辑)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2