Hi,
In Cake 2.x plugin, I could do the following
<?php
App::uses('AppController', 'Controller');
class ApiAppController extends AppController {
public function beforeFilter(){
parent::beforeFilter();
.....
// Once I call $this->set() from here, operation in child classes kinda stops and rendering starts
$this->set([
'status' => "ERROR", 'statusMessage' => "Some validation failed.",
'_serialize' => ['status', 'statusMessage']
]);
}
}
How do i achieve this in Cake 3.x? Such that requests to /api/users.json is halted when child class call parent::initialiaze() and their is a $this->set() in it.