我在我的 app.pagination 中使用了 zend 分页器,但我得到了这个错误 Trying to get property of non-object in
$user = new Zend_Session_Namespace('user');
$user_id =$user->user_id;
$DB = Zend_Db_Table_Abstract::getDefaultAdapter();
$select = $DB->select()
->from(array('p' => 'phone_service'))
->join(array('u' => 'user_preferences'), 'u.phone_service_id = p.phone_service_id')
->where('u.user_preferences_name = ?', 'is_user_package_active')
->where('p.user_id = ?', $user_id);
$adapter = new Zend_Paginator_Adapter_DbSelect($select);
$paginator = new Zend_Paginator($adapter);
$this->view->paginator=$paginator;
在我看来,我正在这样做
foreach($this->paginator as $record){
<td><?php echo $record->phone_service_name;?></td>
<td><?php echo $record->phone_service_type;?></td>
<td ><?php echo $record->phone_service_Duration;?></td>}
这是给出以下错误
Notice: Trying to get property of non-object
在我看来,当我这样做时
var_dump($this->paginator);
[_tableCols:protected] => Array
(
)
there are no data of columns
任何提示PLZ ???