Is there a way to change the Url generated by the LinkPager in Yii2?
I have a page with results that are loaded with ajax when the search field is updated. But my pagination buttons links to a new page with the ajax-call url.
I looked in the files, and it seems like this function generates the url
public function createUrl($page, $pageSize = null, $absolute = false)
and that is not option to change. What is the way to solve this problem?
My results page is at the front page, but the pagination buttons links to ajax/results?page=2&page-size=10.
在Yii2框架中,遇到LinkPager生成的URL与预期的AJAX调用不符的问题。当前,分页按钮导致页面跳转,而非执行AJAX请求。通过检查代码,发现`createUrl`函数没有提供相应的选项来改变URL。为了解决这个问题,可能需要自定义LinkPager组件或者调整其配置,确保分页链接指向前端页面的AJAX结果路径。

1596

被折叠的 条评论
为什么被折叠?



