php - How can i pass two different variables to View -


how can pass 2 different variables view controller(i using codigniter framework).

my fist variable has data records, , second variables has images data.

$dirname = "uploads/"; $images = glob($dirname."*"); // second variable. $this->load->view('includes/template',$data,$images); // not working. 

it should be

$dirname = "uploads/"; $data['images'] = glob($dirname."*"); // second variable. $this->load->view('includes/template',$data); 

you asccess variable in view using $images


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -