我试图了解 Yii 的帖子分页在博客演示应用程序中是如何工作的,我在 firebug 控制台中看到了这个请求:
http://localhost/blog/index.php/post/index?ajax=yw0&Post_page=2
PostController 中的函数“ actionIndex ”似乎没有使用$_GET参数。魔法发生在哪里?
我试图了解 Yii 的帖子分页在博客演示应用程序中是如何工作的,我在 firebug 控制台中看到了这个请求:
http://localhost/blog/index.php/post/index?ajax=yw0&Post_page=2
PostController 中的函数“ actionIndex ”似乎没有使用$_GET参数。魔法发生在哪里?
对于此类事情,您应该检查来源。
索引函数将具有执行此工作CActiveDataProvider的fetchData函数。
基本上 aCListView或 aCGridView调用getData数据提供者的函数,该函数调用fetchData(例如 CActiveDataProvider),后者又调用CPagination'sapplyLimit,它调用getOffset,并且此函数调用getCurrentPage:
if(isset($_GET[$this->pageVar])) // this is where the $_GET is used