Here is what I had to do:

in pluginname/models/article.php

App::import('Model', 'Pluginname.Comment');

class Article extends PluginnameModel {

    $belongsTo = array('Comment');

}


Now in pluginname/controllers/articles_controller.php

I do

$uses = array('Pluginname.Article');




On Apr 21, 3:59 pm, Max <[EMAIL PROTECTED]> wrote:
> Consider a scenario:
>
> In file /app/controllers/users_controller.php
>
> //review is the plugin model which is here: /app/plugins/reviews/
> models/review.php
> var $uses = array('User', 'Review');
>
> function getUserReviews()
> {
>      $reviews = $this->Review->getRecent();   //this will throw sql
> error.. anyone knows a reason? findAll() still works
>
> }
>
> On the other hand, if in bootstrap.php, I manually modify $modelPaths
> array to add the model location. It works just fine. I dont like this
> hack however...
>
> uses('Folder');
> $Folder =& new Folder(APP.'plugins');
> $plugins = $Folder->ls();
>
> foreach($plugins[0] as $plugin)
> {
>         array_push($modelPaths, APP.DS.'plugins'.DS.$plugin.DS.'models'.DS);
>
> }
>
> Abhimanyu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to