控制器中的 CakePHP 自定义分页/分页器未按预期工作 - 我做错了什么?
我可以让我的发现以任何其他方式工作,但我无法通过分页来使其工作。我做错了什么?
视图中的输出:
SQL Error: 1054: Unknown column 'fields' in 'where clause'
Warning (2):** Cannot modify header information - headers already sent by (output started at...
控制器操作:
...
$cond = array(
'fields' => array('id', 'name', 'provider_network_url', 'application_url'),
'conditions' => array('PlanDetail.id' => $id),
'contain' => array(
'Company' => array('fields' => array(
'id',
'name',
'company_logo_url',
'plan_detail_by_company_landing')),
'Plan' => array('fields' => array('id', 'monthly_cost'),
'Applicant' => array('fields' => array('id', 'name')),
'Age' => array('fields' => array('id', 'name')),
'State' => array('fields' => array('id', 'name')),
'Zip' => array('fields' => array('id', 'title')),
'PlanDetail' => array('fields' => array('id', 'name')),
)));
$planDetails = $this->paginate('PlanDetail', $cond);
$this->set(compact('planDetails', $planDetails));
...
I can get my find to work any other way, but I cannot get this working with pagination. What am I doing wrong?
Output in view:
SQL Error: 1054: Unknown column 'fields' in 'where clause'
Warning (2):** Cannot modify header information - headers already sent by (output started at...
Controller Action:
...
$cond = array(
'fields' => array('id', 'name', 'provider_network_url', 'application_url'),
'conditions' => array('PlanDetail.id' => $id),
'contain' => array(
'Company' => array('fields' => array(
'id',
'name',
'company_logo_url',
'plan_detail_by_company_landing')),
'Plan' => array('fields' => array('id', 'monthly_cost'),
'Applicant' => array('fields' => array('id', 'name')),
'Age' => array('fields' => array('id', 'name')),
'State' => array('fields' => array('id', 'name')),
'Zip' => array('fields' => array('id', 'title')),
'PlanDetail' => array('fields' => array('id', 'name')),
)));
$planDetails = $this->paginate('PlanDetail', $cond);
$this->set(compact('planDetails', $planDetails));
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)