我想用Cakephp3.0计算实体的数量,所以,我读了这本书,我找到了查询$number = $this->Models->find()->where(['variables' => 1])->count();,但现在,如何查看我视图中的实体数量?
我有:
$this->set(compact('number'));谢谢!
发布于 2016-04-19 19:07:20
只需在您的视图中使用以下代码:<?=$number?>
https://stackoverflow.com/questions/28386448
复制相似问题