2017-06-20 81 views
0

我對cakePHP相當陌生,我正嘗試使用使用cakePHP的phtagr。我正在嘗試修復它具有的分頁問題。 當我看到$this->request->params['search']的輸出時,它具有pagecount值。phTagr在哪裏設置請求的搜索參數?

function beforeRender($viewFile) { 
     $this->search->iniitialize(); 

     if(isset($this->request->params['search'])){ 

     $this->data = am($this->defaults, $this->request->params['search']); 
     $this->data['page'] = 1; 
     } 
    } else { 
     $this->data = $this->defaults; 
    } 
    } 

打印$this->request->params['search']給出

Array ([pageCount] => 27683 [current] => 0 [nextPage] => 1 [prevPage] => [baseUri] => /explorer/query [afterUri] => [defaults] => Array ([page] => 1 [pos] => [show] => 24 [sort] => -date [view] => small) [data] => Array () [page] =>) 

我怎樣才能找出的pageCount值設定?

回答

1

只需搜索字符串'search'的源文件即可。例如使用grep

grep -r "'search'" /path/to/phTagr/ 

結果:

... 
Controller/Component/SearchComponent.php: $this->controller->request->params['search'] = $params; 
... 

即它在搜索組件被設置。

+0

thanx,我發現它:) – jarus