I am trying to concat between a json object and a cakephp code. to form a valid hyperlink.
this is the json object = item.Customer.customers_name
I want the json object (customer name) to be display in the cakephp hyperlink.
The end result would be
<li class="icn_list_users">
<a href="/admin/scores/edit_test_a_1/345/abcdef/2949/scores">Ty John</a>
</li>
i can't seem top concat js and php together well.
<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>