Код контроллера:
Код: Выделить всё
public function index($data = NULL){
$data1 = $this->test('hotel');
$data2 = $this->test('restaurant');
$data = array_merge($data1,$data2);
$this->load->view('templates/default',$data);
}
public function test($building_type){
$data[$building_type]['title'] = 'this is a title for '.$building_type;
for ($i=1;$i
Подробнее здесь: [url]https://stackoverflow.com/questions/37121125/passing-a-multidimensional-array-from-controller-to-view-in-codeigniter[/url]
Мобильная версия