Pass array from controller to view - Codeigniter

前端 未结 4 1316
感情败类
感情败类 2021-01-14 13:43

I tried to print the array in the controller, before passing it to a view and this is the output

Array ( [annunci] => Array ( [0] => stdClass Object (          


        
4条回答
  •  深忆病人
    2021-01-14 14:42

    (Change $query to $query ['annunci']) OK, the $query is an array already, then just change the view file to 'tab_annunci_view'

    So:

    public function get_annunci(){
        $query=$this->user_model->annunci($this->email);        
        $this->load->view('tab_annunci_view',$query);      
    }
    

提交回复
热议问题