English 中文(简体)
Zend_Paginator with result of Zend_Db_Table_Abstract
原标题:Zend_Paginator with result of Zend_Db_Table_Abstract

i 在模型目录中有许多等级,这些等级是Zend_Db_Table_Abstract。

但是,需要使用zen子,而这种需要是Zend_Db_Select!

在使用该守则时(产品) 类别

$productCat = new ProductCat();
    $rows = $productCat->FetchOrderByPriority();

    // Get a Paginator object using Zend_Paginator s built-in factory.
    $paginator = Zend_Paginator::factory($rows);
$this->view->paginator = $paginator;    

它不工作!

它向我表明这一错误:

Catchable fatal error: Object of class Zend_Db_Table_Row could not be converted to string in 

this is my view code :

<ul><?php foreach ($this->paginator as $item): ?> 
<li><?php echo $item; ?></li><?php endforeach; ?></ul>

是否有任何想法?

最佳回答

出生证肯定有效。 您认为,问题在于你重新尝试使用<代码>,即项目

And it obviously doesn t work since Zend_Paginator::factory($rows) has returned a rowset; so when you re iterating over $paginator object, you re getting objects of Zend_Db_Table_Row type, and you simply cannot echo them.

我认为,你试图做的是:echo<><>一个特定财产:>> 项目/代码>。

echo $item->name;
问题回答

暂无回答




相关问题
Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

Tagging with Zend Framework

I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...

dynamicaly adding textboxes to zend_form

I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...