2
私は 'Sr.によってテーブルを注文したいと思います。いいえ 'を降順に並べ替えます。私はデータベースからではなく、PHPが生成されたので、どうやっているのか分かりません。CakePHP管理パネルの注文
<table>
<tr>
<th>Sr. No</th>
<th>Naslov</th>
</tr>
<?php $counter = 0; foreach($posts as $post) : $counter++; ?>
<tr>
<td><?php echo $counter?></td>
<td><?php echo $this->Html->link($post['Post']['title'], array('controller' => 'Posts', 'action'=> 'view', $post['Post']['id']), array('class' => 'link')); ?></td>
</tr>
<?php endforeach; ?>
<?php unset($post); ?>
</table>
$ postsはどこに定義されていますか? –