use Cake\Controller\Controller;
use Cake\Event\Event;
+use Cake\Core\Configure;
/**
* Application Controller
*/
public function beforeRender(Event $event)
{
-// if (!array_key_exists('_serialize', $this->viewVars) &&
-// in_array($this->response->type(), ['application/json', 'application/xml'])
-// ) {
-// $this->RequestHandler->renderAs($this, 'json');
-// $this->set('_serialize', true);
-// }
-// $this->RequestHandler->renderAs($this, 'json');
-//
-// $this->set('_serialize', true);
+ if (!array_key_exists('_serialize', $this->viewVars) &&
+ in_array($this->response->type(), ['application/json', 'application/xml'])
+ ) {
+ $this->RequestHandler->renderAs($this, 'json');
+ $this->set('_serialize', true);
+ }
+ $this->RequestHandler->renderAs($this, 'json');
+
+ $this->set('_serialize', true);
}