Can't we also load behaviors same way?

Inside /app/models/video.php

        var $actsAs = array('Upload' => array('field' => 'video',
                                                                                
'type' => 'video',
                                                                                
'allowedMime'=>array('video/*'),
                                                                                
'allowedExt' => array('avi','mpg','mpeg','3gp','wmv'),
                                                                                
'dir' => '{WWW_ROOT}{DS}uploads{DS}videos'),
                                                'PluginName.Trackable' => 
array(),
                                           );

This trackable behavior is inside some plugin.. so, will it work?
doesnt look like so.


On Apr 24, 7:04 am, Max <[EMAIL PROTECTED]> wrote:
> Great info... Thanks a lot.
>
> On Apr 22, 11:38 pm, biesbjerg <[EMAIL PROTECTED]> wrote:
>
> > I'll bet echo get_class($this->Review) will output 'AppModel'.
>
> > The reason is you need to define $uses like this when accessing plugin
> > models:
>
> > var $uses = array('User', 'Reviews.Review');
>
> > You should do the same when creating associations within the plugin's
> > models: PluginName.ModelName.
>
> > Good luck.
>
> > On Apr 22, 12:59 am, 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