I want to create a Cakephp delete post link within form like the following. But the very first delete post button doesn't include delete Form when I inspect in browser and can't delete but the others include as I want and can delete.
Is it cakephp bug or something I need to change my source code?
<?php
echo $this->Form->create('Attendance', array('required' => false, 'novalidate' => true));
foreach($i = 0; $i < 10; i++):
echo $this->Form->input('someinput1', value => 'fromdb');
echo $this->Form->input('someinput2', value => 'fromdb');
echo $this->Form->postLink('Delete',array('action'=>'delete',$attendanceid),array('class' => 'btn btn-dark btn-sm col-md-4','confirm' => __('Are you sure you want to delete')));
endforeach;
echo $this->Form->button('Submit', array('class' => 'btn btn-success pull-right'));
echo $this->Form->end();
?>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…