我是 CakePHP 新手,对此控制器有疑问:
function showmy($userid) {
return $this->Voucher->find('all', array('conditions' => array('Voucher.user_id' => $userid)));
}
public function index() {
$this->Voucher->recursive = 0;
$userid = $this->Session->read('Auth.User.id');
$this->set('vouchers', $this->showmy($userid ));
}
我想要登录用户的所有带有 user_id 的凭证。
它有效,但我收到很多错误,例如:
Warning (2): array_filter() expects parameter 1 to be array, null given [CORE\Cake\View\Helper\PaginatorHelper.php, line 419]
也许有经验的人可以给我一些建议!
谢谢,朱利叶斯