MySQL 데이터베이스와 테이블이 있습니다. 임무는 두 개의 매개 변수 (? user_id = ... & action_id ...)를 수신 할 방법을 설정하고 하나만 설정 되었다면이 두 필드 또는 그 중 하나와 일치하는 레코드를 검색합니다 (? user_id = ..). .) 그런 다음 페이지 번호를 매기고 액션보기로 보냅니다. 나는 일주일 전에 Phalcon을 배우기 시작했고, 여기저기서 연구를 해왔으며, 문서를 읽었고 어떻게 할 수 있는지 아직도 깨닫지 못했습니다. 내가 지금까지했던 어떤 :Phalcon : find() + Paginator
public function searchAction()
{
$userID = $this->request->get("user_id", "int", 0);
$actionID = $this->request->get("action_id", "int", 0);
$currentPage = 1;
$currentPage = (int) $_GET["page"];
$parameters = array(
'user_id' => $userID,
'action_id' => $actionID
);
$o = History::find($parameters);
$paginator = new Paginator(array(
"data" => $o,
"limit" => 10,
"page" => $currentPage
));
$page = $paginator->getPaginate();
$this->view->setVar("page", $page);
}
매김 어떻게 든 노력하고 있지만 검색이되지 않습니다, 왜? 공식 문서를 참조