Skip to content

Commit

Permalink
Merge pull request #4 from sarrala/patch-2
Browse files Browse the repository at this point in the history
Allow viewClass override
  • Loading branch information
Mark S. committed Jun 24, 2015
2 parents 6abbe95 + 85e7f32 commit baa216e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Controller/Component/AjaxComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']) {
Expand Down

0 comments on commit baa216e

Please sign in to comment.