0

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

Kal
  • 2,239
  • 6
  • 36
  • 74
  • 1
    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. – RockyFord Jun 11 '13 at 09:54
  • That worked thank, do you mind adding it as the answer so I can accept? :) – Kal Jun 12 '13 at 09:54

1 Answers1

0

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.

RockyFord
  • 8,529
  • 1
  • 15
  • 21