Since CakePHP 1.3, the Ajax helper has been deprecated, one cannot user $ajax->Autocomplete..
I use Cake 2.0, and wish to implement dynamic autocomplete( dynamic table, dynamic field) it seems impossible with current tutorials available.
What is closest alternative to $ajax->autoComplete in cakephp 2.0?
One method I’ve used is to create an Autocomplete Controller (or better yet build it as a plugin), with a method similar to this:
/Views/Autocomplete/fetch.ctp:
To fetch the data, you would use the following URL in your javascript:
e.g.
Edit:
Another alternative is to create an autocomplete method in app controller:
And is called with a url like this:
which will return all users with an email address LIKE ‘%rich%’