CakePHP: FormHelper speichert keine Daten von zwei Eingaben mit demselben Namen

In meinem Formular befindet sich eine lange Reihe von Kontrollkästchen, die ich aus Gründen der Präsentation als zwei Spalten mit Kontrollkästchen anzeigen möchte. Im folgenden Code teile ich die Optionen in zwei separate Arrays auf und erstelle zwei verschiedene Optionen mit demselben Namen. Wenn ichdebug($this->request->data); Der Standortschlüssel ist immer leer. Derselbe Code funktioniert jedoch einwandfrei als einzelne Eingabe. Was mache ich falsch?

<?php
$count = count($location_options); //$location_options is passed from the controller
$half = round( $count/2 );

$location_options1 = array_slice($location_options, 0, $half, TRUE);
$location_options2 = array_slice($location_options, $half, NULL, TRUE);

//I CAN'T GET THIS TO WORK!!
//echo $this->Form->input('location', array('type'=>'select', 'multiple'=>'checkbox', 'options'=>$location_options1, 'div'=>array('class'=>'col-xs-12 col-sm-6 form-group', 'style'=>'margin-bottom:0;', 'selected'=>$user_location_alert_tag_ids))); 
//echo $this->Form->input('location', array('type'=>'select', 'multiple'=>'checkbox', 'options'=>$location_options2, 'div'=>array('class'=>'col-xs-12 col-sm-6 form-group', 'selected'=>$user_location_alert_tag_ids))); 

//BUT THIS WORKS JUST FINE
echo $this->Form->input('location', array('type'=>'select', 'multiple'=>'checkbox', 'options'=>$location_options, 'div'=>array('selected'=>$user_location_alert_tag_ids))); 
?>

Antworten auf die Frage(1)

Ihre Antwort auf die Frage