これはすべての検索結果がforeach
ループから来ているコントローラファイルです。どのようにそれを行うかを理解する。CakePHP 3.xを使用して検索結果をページングし、テンプレートの表示ファイルに表示しようとしています
<?php
class SerController extends AppController
{
public function initialize()
{
parent::initialize();
$this->loadComponent('Paginator');
}
public function index()
{
$check_string=$this->request->data('check');
$check_break=explode(" ",$check_string);
$s1=TableRegistry::get('ser_tab');
foreach($check_break as $check)
{
$s11=$s1->find('all')->where(['OR' =>['text LIKE' => '%'.$check.'%','name LIKE' => '%'.$check.'%']]);
$this->set(array('data' => $s11));
}
$this->render('index');
}
}
DualController.php
パブリック関数指数(){
} **全文検索**のhttp://www.hackingwithphp .com/9/3/18/advanced-text-searching-full-text-indexesを使用してください – tarikul05
ページネーションを使用して見てくださいhttp://stackoverflow.com/a/6184178/3278789 – tarikul05