//以对象的形式获取数据库$data变量的信息,将lastPage()传输至页面 $lastpage = $data->lastPage(); $this->assign('lastpage', $lastpage);
<select name="page" id="page" > <option value="1">请选择您要搜索的分页页码</option> {for start="1" end="$lastpage+1"} <option value="{$i}">{$i}</option>> {/for} </select> //引入jq 页面加载shij <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $("#page").change(function (){ var page=$("#page").val(); location.href='http://www.1906a.com/task/article/index/page/'+page; }) </script>