src/Controller/Api/UsersController.php
public function index()
    {
        $this->Crud->on('beforePaginate', function (Event $event) {
            $query = $this->Users->find('search', $this->request->query);
            $query = $query->select(['id', 'username']);
            $event->subject->query = $query;
        });
        $this->Crud->execute();
    }
public function index()
    {
        $this->Crud->on('beforePaginate', function (Event $event) {
            $query = $this->Users->find('search', $this->request->query);
            $query = $query->select(['id', 'username']);
            $event->subject->query = $query;
        });
        $this->Crud->execute();
    }
public function index ( ) { $ this -> Crud -> on ( 'beforePaginate' , function ( Event $ event ) { $ query = $ this -> Users -> find ( 'search' , $ this -> request -> query ) ; $ query = $ query -> select ( [ 'id' , 'username' ] ) ; $ event -> subject -> query = $ query ; } ) ; $ this -> Crud -> execute ( ) ; }
Currently used as a search function uses 'username' as the param

e.g. http://example.com/api/users.json?usernam=phil

@return void
Currently used as a search function uses username as the param