parent
c8f8c5cc27
commit
b73811fefc
|
|
@ -418,17 +418,6 @@ class Controller extends Extendable
|
|||
throw new ApplicationException(Lang::get('cms::lang.ajax_handler.not_found', ['name'=>$handler]));
|
||||
}
|
||||
|
||||
/*
|
||||
* If the handler returned an array, we should add it to output for rendering.
|
||||
* If it is a string, add it to the array with the key "result".
|
||||
*/
|
||||
if (is_array($result)) {
|
||||
$responseContents = array_merge($responseContents, $result);
|
||||
}
|
||||
elseif (is_string($result)) {
|
||||
$responseContents['result'] = $result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Render partials and return the response as array that will be converted to JSON automatically.
|
||||
*/
|
||||
|
|
@ -456,6 +445,17 @@ class Controller extends Extendable
|
|||
if ($this->hasAssetsDefined()) {
|
||||
$responseContents['X_OCTOBER_ASSETS'] = $this->getAssetPaths();
|
||||
}
|
||||
|
||||
/*
|
||||
* If the handler returned an array, we should add it to output for rendering.
|
||||
* If it is a string, add it to the array with the key "result".
|
||||
*/
|
||||
if (is_array($result)) {
|
||||
$responseContents = array_merge($responseContents, $result);
|
||||
}
|
||||
elseif (is_string($result)) {
|
||||
$responseContents['result'] = $result;
|
||||
}
|
||||
|
||||
return Response::make()->setContent($responseContents);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue