1

我有以下控制器类别:

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());
4

0 回答 0