Javascript sfPropelPager仅生成5页

Javascript sfPropelPager仅生成5页,javascript,symfony1,propel,pager,symfony-plugins,Javascript,Symfony1,Propel,Pager,Symfony Plugins,我正在做一个symfony项目,需要为长列表创建一个分页系统。我使用sfPropelPager插件来生成它们。我是这样用的: 我以不同的标记打印所有页面,并且只将第一个设置为可见。然后通过javascript函数,我在单击next、prev、。。。纽扣 我用于生成页面的函数如下所示: ` 视图代码为: foreach($pager->getLinks() as $page){ echo'<div id="logpage'.$page.'" class

我正在做一个symfony项目,需要为长列表创建一个分页系统。我使用sfPropelPager插件来生成它们。我是这样用的:

我以不同的
标记打印所有页面,并且只将第一个设置为可见。然后通过javascript函数,我在单击next、prev、。。。纽扣

我用于生成页面的函数如下所示: `

视图代码为:

        foreach($pager->getLinks() as $page){

        echo'<div id="logpage'.$page.'" class="logpages" style="width:100%;';
        if($page!=1){echo ' display:none';}
        echo '">';

        $pager->setPage($page);
        $pager->init();
        $results= $pager->getResults();

        echo '<table class="none_list" id="list">';
        echo "<thead>";
        echo "<td width='8%'>Usuario</td><td width='8%'>Acci&oacute;n</td>";
        echo "<td width='13%'>Campo</td><td width='25%'>Valor Antiguo</td>";
        echo"<td width='25%'>Nuevo valor</td><td width='21%'>TimeStamp</td>";
        echo "</thead>";
        foreach($results as $log){
            echo '<tr id="'.$log->getCodigoLog().'" >';

            < here goes each entry in the page display, not relevant >


        }
        echo '</table>';

        echo "<div style='float:left'>";
        echo image_tag('first.png',array('class'=>"first"));
        echo image_tag('previous.png',array('class'=>"previous"));
        echo "</div>";
        foreach($lista->getLinks() as $page){
            echo "<div class='logindex' id='".$page."' style='float:left; cursor:pointer'>";
            if($page == $lista->getPage()){
                echo "<b>".$page."</b>";
            }else{
                echo $page;
            }
            echo "</div>";
        }
        echo image_tag('next.png',array('class'=>"next"));
        echo image_tag('last.png',array('class'=>"last"));
    echo '</div>';
    $lista->setCursor($lista->getNextPage());

}
$lista->setCursor($lista->getFirstPage());?>
foreach($pager->getLinks()作为$page){
回声';
$pager->setPage($page);
$pager->init();
$results=$pager->getResults();
回声';
回声“;
回声“UsuarioAcció;n”;
回声“CampoValor Antiguo”;
回声“新瓦勒提梅斯塔姆”;
回声“;
foreach($结果为$log){
回声';
<页面显示中的每个条目如下,不相关>
}
回声';
回声“;
回波图像标签('first.png',数组('class'=>“first”);
回波图像标签('previous.png',数组('class'=>“previous”);
回声“;
foreach($lista->getLinks()作为$page){
回声“;
如果($page==$lista->getPage()){
回显“$page.”;
}否则{
echo$页;
}
回声“;
}
回波图像标签('next.png',数组('class'=>“next”);
回波图像标签('last.png',数组('class'=>“last”);
回声';
$lista->setCursor($lista->getNextPage());
}
$lista->setCursor($lista->getFirstPage());?>
问题是SFPROPERPAGER最多只能生成5页


你知道我必须在哪里配置这个来显示所有页面吗??谢谢大家!

分页非常简单-这里是Jobeet教程上的一个很好的示例->

如果您检查,您将看到它有一个
$nb_links
参数,告诉您需要多少链接。默认值为5。

能否添加一些“相关”代码?创建寻呼机的控制器部分和渲染寻呼机的视图部分?我对你的每页项目设置(
$pager->getMaxPerPage()
)和结果数(
$pager->count()
)很好奇。我很久以前就做了教程,当我检测到这种行为时进行了修改,但我没有找到结果solution@AndreuHeineken您在操作中的页面设置在哪里?->$这个->页面->设置页面($request->getParameter('page',1))@AndreuHeineken如果你遵循文档是可行的-如果你开始移动东西-比如把代码放在视图中。。。它不…(1)第一段代码不在动作中,而是在一个模型文件中,所以$this->pager不是必需的。(2) 我不在动作中设置页面,而是生成所有页面。这和我的问题有什么关系?(3) 我的需求与解决文档示例的需求不同,因此我不能100%地遵循它。谢谢你。
        foreach($pager->getLinks() as $page){

        echo'<div id="logpage'.$page.'" class="logpages" style="width:100%;';
        if($page!=1){echo ' display:none';}
        echo '">';

        $pager->setPage($page);
        $pager->init();
        $results= $pager->getResults();

        echo '<table class="none_list" id="list">';
        echo "<thead>";
        echo "<td width='8%'>Usuario</td><td width='8%'>Acci&oacute;n</td>";
        echo "<td width='13%'>Campo</td><td width='25%'>Valor Antiguo</td>";
        echo"<td width='25%'>Nuevo valor</td><td width='21%'>TimeStamp</td>";
        echo "</thead>";
        foreach($results as $log){
            echo '<tr id="'.$log->getCodigoLog().'" >';

            < here goes each entry in the page display, not relevant >


        }
        echo '</table>';

        echo "<div style='float:left'>";
        echo image_tag('first.png',array('class'=>"first"));
        echo image_tag('previous.png',array('class'=>"previous"));
        echo "</div>";
        foreach($lista->getLinks() as $page){
            echo "<div class='logindex' id='".$page."' style='float:left; cursor:pointer'>";
            if($page == $lista->getPage()){
                echo "<b>".$page."</b>";
            }else{
                echo $page;
            }
            echo "</div>";
        }
        echo image_tag('next.png',array('class'=>"next"));
        echo image_tag('last.png',array('class'=>"last"));
    echo '</div>';
    $lista->setCursor($lista->getNextPage());

}
$lista->setCursor($lista->getFirstPage());?>