Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:27:51+00:00 2026-05-28T02:27:51+00:00

i am using zend paginator for pagination in my app here is the action

  • 0

i am using zend paginator for pagination in my app here is the action that is doing so

public function listAction(){
      $registry = Zend_Registry::getInstance();  
      $DB = $registry['DB'];
      $sql = "SELECT * FROM `task` ORDER BY task_name ASC";
      $result = $DB->fetchAll($sql);
      $page=$this->_getParam('page',1);
      $paginator = Zend_Paginator::factory($result);
      $paginator->setItemCountPerPage(3);
      $paginator->setCurrentPageNumber($page);
      $this->view->paginator=$paginator;
  }

and this is the view for this action

 <table border="1" align="center">
<tr>
  <th>Task Name</th>      
  <th>Task Assign To</th>  
  <th>Action</th>     
</tr>
   <?php
    foreach($this->paginator as $record){ ?>
    <tr> 
   <td><?php echo $record['task_name']?></td>
  <td><?php echo $record['task_assign']?></td>  

  <td>
    <a href="edit/id/<?php echo $record['id']?>">Edit</a>
    |
    <a href="del/id/<?php echo $record['id']?>">Delete</a>      
  </td>   
</tr> 
   <?php } ?>
  </table>
   <?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>

by doing so it giving me this error

Fatal error: Cannot use object of type stdClass as array in C:\xampp\htdocs\zend_login\application\views\scripts\task\list.phtml on line 47

line 47 refers to

 <td><?php echo $record['task_name']?></td>

than i used this function to convert object to array

function objectToArray( $object ){
 if( !is_object( $object ) && !is_array( $object ) ){
  return $object;}
 if( is_object( $object ) ){
 $object = get_object_vars( $object );}
return array_map( 'objectToArray', $object );}
$paginator = objectToArray($this->paginator);

now i change this in my code

foreach($paginator as $record){

and also this

   <?php echo $this->paginationControl($paginator, 'Sliding', 'pagination.phtml'); ?>

but its giving me this error now

 Catchable fatal error: Argument 1 passed to Zend_View_Helper_PaginationControl::paginationControl() must be an instance of Zend_Paginator, array given in C:\xampp\htdocs\zend_login\library\Zend\View\Helper\PaginationControl.php on line 88

can you please tell what i am missing i am new to zend so please dont mind my awkward question
this is my ErrorController.php

class ErrorController extends Zend_Controller_Action{
public function errorAction()
{
    $errors = $this->_getParam('error_handler');

    switch ($errors->type) {
        case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
        case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
        case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:

            // 404 error -- controller or action not found
            $this->getResponse()->setHttpResponseCode(404);
            $this->view->message = 'Page not found';
            break;
        default:
            // application error
            $this->getResponse()->setHttpResponseCode(500);
            $this->view->message = 'Application error';
            break;
    }

    // Log exception, if logger available
    if ($log = $this->getLog()) {
        $log->crit($this->view->message, $errors->exception);
    }

    // conditionally display exceptions
    if ($this->getInvokeArg('displayExceptions') == true) {
        $this->view->exception = $errors->exception;
    }

    $this->view->request   = $errors->request;
}

public function getLog()
{
    $bootstrap = $this->getInvokeArg('bootstrap');
    if (!$bootstrap->hasPluginResource('Log')) {
        return false;
    }
    $log = $bootstrap->getResource('Log');
    return $log;
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:27:51+00:00Added an answer on May 28, 2026 at 2:27 am

    You just need to call it as an object:

    <td><?php echo $record->task_name; ?></td>
    

    UPDATE: all other errors resolved in chat

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using zend paginator in my app.pagination works well but i get this
I'm using Zend Paginator here, in an ajax request I am retrieving objects based
so I've been using Zend Pagination, and I don't like the fact that I
so I'm currently using Zend Paginator because I'm having the impression that it doesn't
Using Zend Paginator and the paginator cache works fine, but the same cached pages
hi i am using zend form , i created a Zend_Form_Element_Radio element that have
Im using Zend form. What should I do to get correct action parameter in
Can someone help me achieve multiple zend pagination in a view using ajax. I
I started using Zend_Paginator, it works everything fine but I noticed that there is
I was looking at Zend_Paginator in Zend Framework project using MVC, and it looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.