[eluser]Ngulo[/eluser]
hi all guys , i'm trying to push inside my array some new value the script is simple:
Controller.php:
Code:
foreach($populateOrders as $row ){
$id = $row->id;
$newvalue = "asd";
$this->order_bills->populateById($id);
$ordersList = array(
'id'=>$row->id,
'id_user'=>$row->id_user,
'firstname'=>$row->firstname,
'lastname'=>$row->lastname,
'status'=>$row->status,
'delivery_type'=>$row->delivery_type,
'payment_type'=>$row->payment_type,
'total'=>$row->total,
'registration_datetime'=>$row->registration_datetime,
'pdf'=>$row->pdf,
'newvalue'=>$newvalue
);
}
$view['orderList'] = array('list'=>array_slice($ordersList,$offset,$per_page));
$this->load->view('admin/orders/orders_view',$view);
View.php
Code:
<?php foreach($orderList['list'] as $row){?>
<tr class="tr-right-options" id="tr-fade-out-<?php echo $row->id ?>">
<td><?php echo $row->id ?></td>
<td class="order-firstname"><strong><?php echo $row->firstname ?></strong></td>
<td class="order-lastname"><strong><?php echo $row->lastname ?></strong></td>
<!-- <td class="order-email"><strong><?php //echo $row->email ?></strong></td>-->
<td><?php echo $row->status ?></td>
<td><?php echo $row->delivery_type ?></td>
etc etc........
so if i try to push inside controller $populateOrders array newvalue then in my view i receive error message (Message: Trying to get property of non-object) how can i solve this problem?
p.s: $populateOrders is generated by model and it is simply result array from $query->result();