public function afterPaginate(Event $event)
    {
        $event;
        if (!$this->_table()->behaviors()->has('Search')) {
            return;
        }

        $enabled = $this->getConfig('enabled') ?: !$this->_request()->is('api');
        if (!$enabled) {
            return;
        }

        $fields = $this->fields();
        $this->_controller()->set('searchInputs', $fields);
    }
public function afterPaginate(Event $event)
    {
        $event;
        if (!$this->_table()->behaviors()->has('Search')) {
            return;
        }

        $enabled = $this->getConfig('enabled') ?: !$this->_request()->is('api');
        if (!$enabled) {
            return;
        }

        $fields = $this->fields();
        $this->_controller()->set('searchInputs', $fields);
    }
public function afterPaginate ( Event $ event ) { $ event ; if ( ! $ this -> _table ( ) -> behaviors ( ) -> has ( 'Search' ) ) { return ; } $ enabled = $ this -> getConfig ( 'enabled' ) ? : ! $ this -> _request ( ) -> is ( 'api' ) ; if ( ! $ enabled ) { return ; } $ fields = $ this -> fields ( ) ; $ this -> _controller ( ) -> set ( 'searchInputs' , $ fields ) ; }
After paginate event callback.

Only after a crud paginate call does this listener do anything. So listen
for that

@param \Cake\Event\Event $event Event.
@return void
After paginate event callback .