Controller中的Ajax分页$ _GET参数

时间:2012-12-15 18:11:46

标签: ajax yii pagination

我正在尝试了解如何在博客演示应用中对帖子进行Yii分页,并且我在firebug控制台中看到了此请求:

http://localhost/blog/index.php/post/index?ajax=yw0&Post_page=2

功能' actionIndex'在 PostController 中似乎没有使用$_GET参数。魔法在哪里发生?

1 个答案:

答案 0 :(得分:2)

对于这些事情你应该检查来源。

索引函数将有一个CActiveDataProvider fetchData函数可以正常工作。

基本上CListViewCGridView调用getData function of a data provider,调用fetchData (say of CActiveDataProvider),然后调用CPagination's applyLimit,调用getOffset },此函数调用getCurrentPage

if(isset($_GET[$this->pageVar])) // this is where the $_GET is used
相关问题