So I was able to get around the issue. The issue is autocomplete needing the response specified. ajaxCall doesn't have a real callback on success, so there is no way to set the response with the data that gets returned. I decided to go a round about way and set everything manually. This is what I came up with.
include\component\controller\mycontroller.class.php
$this->template()->assign(array('token' => Phpfox::getService('log.session')->getToken());
template\default\somehtml.html.php
<input id="security_token" type="hidden" name="phpfox[security_token]" value="{$token}" />
static\jscript\myjavascript.js
$("#searchPlaces" ).autocomplete({
source:function( request, response ) {
$.ajax({
url: "/static/ajax.php",
minLength: 1,
dataType: "json",
data: {
startsWith: request.term,
'core[security_token]': $("#security_token").val(),
'core[ajax]': true,
'core[call]': 'mymodule.myfunction'
},
success: function( data ) {
response( data );
}
});
},
autoFocus: true
});
include\component\ajax\ajax.class.php
public function myfunction(){
$yourdata = array("1" ,"2", "3", "4");
$this->call(json_encode($yourdata ));
}
Basically the security token is set via a hidden element. The url will always be url: "/static/ajax.php",
as this will take care of calling the ajax file for you. 'core[call]': 'mymodule.myfunction'
this is set to how you would use $.ajaxCall('mymodule.myfunction')
. All you need to do is find the autocomplete items you want to return as normal now.
Hopefully this helps in case someone else gets in the same situation.