普通网友 2013-06-10 10:53
浏览 48
已采纳

Zend Paginator无法找到视图文件

I have extended the Zend paginator so I can use it in my own service layer. The issue is getting it to display in my view. (My admin page is not in a view/script folder but in a some legacy code in public - don't ask lol). I have got an instance of view from the bootstrap and I am trying to display the paginator.

Fatal error: Uncaught exception 'Zend_View_Exception' with message 'no view script directory set; unable to determine location for view script' in /usr/share/php/Zend/View/Abstract.php:973

$adapter = new Think_Paginator_Adapter_ServiceQuery($logging, 'getAllActions');
    $paginator = new Zend_Paginator($adapter);
<table>
<?php foreach($paginator as $data){ ?>
                    <tr>
                    <td><?php echo $data->adminId ?></td>
                    <td><?php echo $data->lastName ?></td>
                    <td><?php echo $data->firstName ?></td>
                    <td><?php echo $data->loanId ?></td>
                    <td><?php echo $data->createTimestamp ?></td>
                    <td><?php echo $data->action ?></td>
                    </tr>    
                <?php } ?>
                    <?php 
                   echo $view->paginationControl($paginator,
                                    'Sliding',
                                    'pagination.phtml');
                   ?>
                </table>

Any idea why it's not finding my pagination.phtml in the view/scripts dir?

Thanks

  • 写回答

1条回答 默认 最新

  • douwo4837 2013-06-13 08:18
    关注

    It's not a problem with paginator the application is not finding the default script paths, maybe try

    $view->addScriptPath('PATH');

    or

    $view->setScriptPath('PATH').

    You may have broken something in the bootstrap.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历