문제

I have created a dropdown list in cakephp as below :

$city_list = $form->select("GalStore.gal_location_id", $gal_locations,null,$city_attributes); 

Now I needed to send the names of the list in a array, ie in <select name="mylist[]"> format.

I tried to put [] in the above variable :

$city_list = $form->select("GalStore.gal_location_id[]", $gal_locations,null,$city_attributes); 

But its producing HTML as :

<select name="data[GalStore][gal_location_id[]]">

How can I achieve it ?

올바른 솔루션이 없습니다

다른 팁

I am not sure what exactly you are looking for, but this will give you the general idea.

$city_list = $form->select("GalStore.gal_location_id.0", $gal_locations,null,$city_attributes); 
// or
$city_list = $form->select("GalStore.0.gal_location_id", $gal_locations,null,$city_attributes); 

change the 0, as needed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top