How to create a link using the CakePHP conventions inside JQuery?
I'm trying like this but I still can not get it to work.
$(document).ready(function() {
$('#dataTables-example').DataTable({
"processing": true,
"serverSide": true,
"ajax":{
url: "<?php echo $this->Html->url("/Empresas/indexAjax.json");?>",
dataSrc:""
},
"columns": [
{"data": "Empresa.id"},
{"data": "Empresa.nomeFantasia"},
{"data": "Empresa.cnpj"},
{"data": "Empresa.telefone1"},
{"data": "Empresa.telefone2"},
{"data": "Empresa.celular"},
{"data": "Empresa.aberto"},
{"data":null,
"bSortable": false,
"render": function(obj) {
return "<?php echo $this->Html->link('<i class="glyphicon glyphicon-eye-open"></i>',
array('action' => 'view', obj["Empresa"].id),
array('title'=>'view', 'escape' => false)); ?>";
//return '<a href=/Produto/Detalhar/' + o["Empresa"].id + '>' + 'More' + '</a>';
}
}
]
});
});