当我点击按钮时,我试图在last inserted id
中通过表单操作传递Cakephp
。
我是Cakephp
的新手。这是我发现的代码。你可以通过Form
建议最后插入的正确方法吗?
<?php echo $this->Html->link('View Quote', array('controller' => 'Stockcheck', 'action' => '../Quote/QuoteNo=Q1-1'), array('class' => 'button')); ?>
QuoteNo = Q1-1应该是我最后插入的ID而QuoteNo是我的字段
答案 0 :(得分:0)
试试这段代码:
echo $this->Html->link('View Quote', array('controller' => 'Stockcheck', 'action' => '../Quote/', $your_id));
如需更多帮助,请阅读此link
答案 1 :(得分:0)
<?= $this->Form->postLink('<i class="fa fa-trash-o"></i><span class="hidden-xs"> ' . __('Delete') . '</span>', ['_name' => 'delete-administrator', $administrator->id], ['confirm' => "Are you sure you want to delete {$administrator->full_name}?", 'class' => 'btn btn-sm red', 'escape' => false, 'title' => 'Delete administrator details']); ?>
<?= $this->Form->postLink('<i class="fa fa-trash-o"></i><span class="hidden-xs"> ' . __('Delete') . '</span>', ['_name' => 'edit-administrator', $administrator->id], ['class' => 'btn btn-sm red', 'escape' => false, 'title' => 'Edit administrator details']); ?>
- 使用路线名称