我想從postlink獲取id值。這裏是index.ctp刪除postlinkCakePHP 2.4:如何從cakephp中的postlink獲取id值?
<?php
echo $this->Form->postLink(
$this->Html->tag('i', '', array('class' => 'glyphicon glyphicon-remove')),
array('action' => 'delete', $user['User']['id'],'class'=>'del'),
array('escape'=>false,'class'=>'btn btn-sm btn-danger'),
__('Are you sure you want to delete # %s?', $user['User']['id'])
);
?>
我已經jQuery的
$('document').ready(function(){
var x=jQuery(this).attr("id");
alert(x);
});
在這裏,我沒有得到任何value.How得到這個ID爲AJAX提交試過婁代碼?