Since cakephp 2, I used to sort articles this way :
<table>
<tbody id="sortable">
<?php
$line = 0;
foreach ($articles as $article) {
echo $this->Form->control($line. '.id', [
'type' => 'hidden',
'value' => $article->id
]);
echo '<tr>';
echo '<td>' . $this->Form->control($line . '.name', [
'label' => '',
'value' => $article->name,
'readonly' => true
]);
echo '</td>';
echo '<td class="sort">' . $this->Form->control($line . '.sort', [
'label' => '',
'value' => $article->sort,
'type' => 'text',
'pattern' => '\d+',
'readonly' => true,
]);
echo '</td>';
echo '</tr>';
$line ++;
}
?>
</tbody>
</table>
(I used input instead of control of course)
But now in 4.x, I get an error when submitting the form :
`Missing field '0.sort, 1.sort, 2.sort' in POST data`
Why do sort fields dot not get transmitted ?
Is there any tuto or article explaining the right way to do this ?