diff --git a/src/Controller/Component/AjaxComponent.php b/src/Controller/Component/AjaxComponent.php index b93dca3f..dbc9d5f7 100644 --- a/src/Controller/Component/AjaxComponent.php +++ b/src/Controller/Component/AjaxComponent.php @@ -32,6 +32,7 @@ class AjaxComponent extends Component { public $respondAsAjax = false; protected $_defaultConfig = array( + 'viewClass' => 'Ajax.Ajax', 'autoDetect' => true, 'resolveRedirect' => true, 'flashKey' => 'Flash.flash' // Use "messages" for Tools plugin Flash component, set to false to disable @@ -79,7 +80,7 @@ public function beforeRender(Event $event) { * @return void */ protected function _respondAsAjax() { - $this->Controller->viewClass = 'Ajax.Ajax'; + $this->Controller->viewClass = $this->_config['viewClass']; // Set flash messages to the view if ($this->_config['flashKey']) {