次のコントローラ カテゴリがあります。
App::uses('Folder', 'Utility');
class CategoriesController extends AppController {
public $components = array('Paginator');
public function index() {
$this->Category->recursive = 0;
$this->set('categories', $this->Paginator->paginate());
}
public function view($id = null) {
if (!$this->Category->exists($id)) {
throw new NotFoundException(__('Invalid category'));
}
$options = array('conditions' => array('Category.' . $this->Category->primaryKey => $id));
$this->set('category', $this->Category->find('first', $options));
}
.......
そして私は使用してい$uses
ます:
public $uses = array('Book', 'Chapter');
これらは私のサイトで発生しているエラーです:
Notice (8): Indirect modification of overloaded property BooksController::$Book has no effect [APP\Controller\BooksController.php, line 26]
Warning (2): Creating default object from empty value [APP\Controller\BooksController.php, line 26]
// Line 26: $this->set('categories', $this->Paginator->paginate());