Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在实现一个带有分页的简单小部件,但遇到了一个小问题。
当我在页面上有少量项目时,不会生成分页,但是当我有很多项目时,一切都很好。
问题是:如何强制分页呈现,即使只有一页有记录?
您基本上只需在数据提供者/活动记录上指定页面大小
$model = new CArrayDataProvider( $dataRow, array('pagination'=> array('pageSize'=>5) ));