How to access a plugin model from a regular controller in PHP Cake 1.1

Posted by Duncan on Stack Overflow See other posts from Stack Overflow or by Duncan
Published on 2010-04-28T17:10:49Z Indexed on 2010/04/28 17:13 UTC
Read the original article Hit count: 265

Filed under:
|
|

Hopefully a simple question: I've a plugin which uses a set of tables (kb_items, kb_item_tags, etc). and I'd like to be able to access these models from another controller (say, my Pages controller), thus:

class PagesController extends AppController{

function knowledgebase(){
  $items = $this->KbItem->findAll(...);
}

}

I am admittedly breaking the rules a little (by not placing this controller inside the knowledge base plugin), but this in this case its a custom page that doesn't need to be part of the knowledge base plugin code base.

Please let me know if you need more details. Thanks in advance for any help!

© Stack Overflow or respective owner

Related posts about php

Related posts about cakephp