Welcome Guest, Not a member yet? Register   Sign In
Modifing dynamic data to views inside controller
#1

[eluser]OneCorea[/eluser]
Hi, This is a first after hardwork process, 'cause I can't receive activation email of some account.
Anyway....... Smile

I'd like to modify the result dataset object field before sending them to views..

<Model>
Code:
function getList(, ,){
   $sql = "..."
   $query = $this->db->query($sql);
   if($query->num_rows() > 0){
    return $query->result();
   }
   else { return false; }
}

<Views>
Code:
foreach($list_obj as $obj){
   echo $obj->subject;
   echo $obj->name;
...
}

<Controller>
Code:
$data['list_obj'] = $this->board_model->getList($code, $from_list, $offset);
====>" From Here, object field modification section....."
==>$data['list_obj']->subject = "Re:".subject.".....";// <--- of course it isn't worked, just for example..
$this->load->views('bList', $data);
==========================
Consequently, I'd like to modify the $query->result() object dataset field before they are sent to the views..
Is there a solution to solve my problem in CI?..

From Real Inovice CI!!!!


Messages In This Thread
Modifing dynamic data to views inside controller - by El Forum - 08-30-2007, 04:00 AM
Modifing dynamic data to views inside controller - by El Forum - 08-30-2007, 08:56 AM
Modifing dynamic data to views inside controller - by El Forum - 08-30-2007, 09:51 AM
Modifing dynamic data to views inside controller - by El Forum - 08-30-2007, 10:11 AM
Modifing dynamic data to views inside controller - by El Forum - 09-02-2007, 11:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB