2017-06-20 67 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