create a multiselect dropdown with 3-story levels

Multi tool use
Multi tool use


create a multiselect dropdown with 3-story levels



I am making a multi-story multiselect dropdown with 3 level, level 1 and 2 is successfully performed, but for level 3 error (error array to string).How to solve it?
I attach the following code:



model :


function getZonaTree2() {
$types = $this->getZonaType();
$tree = array(''=>'-- Region --');
$this->getListTreeParent($listZona, 0, 0);
foreach($listZona as $r) {
if($r->LEVEL==1) {
$tree[$r->ZONA_NAME] = array();
$zona_parent_1 = $r->ZONA_NAME;
}
if($r->LEVEL==2) {
$tree[$zona_parent_1][$r->ZONA_NAME] = array();
$zona_parent_2 = $r->ZONA_NAME;
}
if($r->LEVEL==3) {
$tree[$zona_parent_1][$zona_parent_2][$r->ZONA_ID] = $r->ZONA_NAME." (".$r->ZONA_CAPITAL.") - ".$types[$r->TYPE];
}
}
return $tree;
}



view :


<?php
echo form_multiselect('zona_id', $this->Zona_model->getZonaTree2(), array(), "size=8 id='zona_id'");
?>



display error :
display error



the display should :
the display should





please provide a usable array example of the output of $this->Zona_model->getZonaTree2() ... enough to replicate for example Sumatrera -> Aceh -> Aceh Barat or similar. I have limited knowledge of this function but it seems like it doesn't support as nested of an array as you have.
– Alex
Jul 3 at 8:32



$this->Zona_model->getZonaTree2()









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

0cDt a9xTH,Pqw76eIujPoamsc4 yjmVvXUhfJfgBfDuMpdM2wnfCnrc0SyNEzXW7fmP
8PU2dqfhjzt4Rcisb9,f3PGu

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications