phTagr在哪里设置请求'搜索'参数?

时间:2017-06-20 21:14:38

标签: cakephp cakephp-2.x

我是cakePHP的新手,我正在尝试使用cakePHP的phtagr。我正在尝试修复它的分页问题。 当我看到$this->request->params['search']的输出时,它具有pagecount值。

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 个答案:

答案 0 :(得分:1)

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

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

结果:

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

即它正在搜索组件中设置。