So here is the situation: I have my default.ctp and my ajax.ctp where my ajax.ctp is just the blank $content_for_layout;
When i'm doing an autocomplete ajax call I must change the layout to 'ajax' obviously. So I have this function in my controller
function beforeFilter() {
if($this->RequestHandler->isAjax()) {
$this->layout = 'ajax';
}
}
However when i look at the results of my autocomplete I get this in my options:
- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
- html xmlns="http://www.w3.org/1999/xhtml">
Which basicly is my default layout. So my guess is that the layout didn't change
Anyone else encountered this problem? Did I forget to add something in my controller ? All the helpers and components are in place.