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]));
|
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.
|
* Render partials and return the response as array that will be converted to JSON automatically.
|
||||||
*/
|
*/
|
||||||
|
|
@ -457,6 +446,17 @@ class Controller extends Extendable
|
||||||
$responseContents['X_OCTOBER_ASSETS'] = $this->getAssetPaths();
|
$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);
|
return Response::make()->setContent($responseContents);
|
||||||
}
|
}
|
||||||
catch (ValidationException $ex) {
|
catch (ValidationException $ex) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue