我想连接json对象和cakephp代码之间。形成有效的超链接。concat JavaScript与cakephp
这是JSON对象= item.Customer.customers_name
我想JSON对象(客户名称)是在超链接的CakePHP显示。
的最终结果将是
<li class="icn_list_users">
<a href="/admin/scores/edit_test_a_1/345/abcdef/2949/scores">Ty John</a>
</li>
不是我似乎能顶CONCAT js和PHP的吻合。
<script type="text/javascript">
$.getJSON("http://localhost:8888/tests/teststudents.json?id=<?php echo $this->params['pass'][1]; ?>", function(data) {
var ul = $('#teststudents');
$.each(data, function (i, item) {
ul.append($('<li class="icn_list_users"><?php echo $html->link(' + item.Customer.customers_name + ', array('admin'=> true, 'controller' => 'scores','action' => $scoresheetpath, $this->params['pass'][1],$range)); ?></li>'));
});
});
</script>