我想在 CakePhp 上限制我的数据库数据。它可以通过 find 命令进行限制,但我不知道是否可以限制我的使用。这是我的 posts_controller.php 文件中的代码:
function index() {
$this->Post->order = array('order'=>'Post.date DESC','limit'=>5);
$this->Post->recursive = 0;
$this->set('posts', $this->paginate());
}