Pass array from controller to view - Codeigniter

前端 未结 4 1294
感情败类
感情败类 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条回答
  •  梦毁少年i
    2021-01-14 14:25

    public function index()
        {
            $data=$this->model->viewBlog();
            $this->load->view('blog/index',['data'=>$data]);
        }
    

    I hope this is work. if you handle n number of records use this method.

提交回复
热议问题