The model should not be called Sortable. Then it's fine.
As components are registered besides models

// controller
$this->Sortable->foo() // component

whereas behavior methods are used just as if they were part of the model

// controller
$this->MyModel->foo() // behavior


Am Dienstag, 6. August 2013 22:57:54 UTC+2 schrieb advantage+:
>
> That was just a typo and just a sample example. So correct if it was 
>
>  
>
> public $actsAs = array('Sortable.Sortable');
>
>  
>
> and component defined in App controller the question remains the same.
>
>  
>
> In any controller using this where is Cake looking for the sortable->sort 
> function such as
> "$this->Sortable->sort($data);" Is it looking for the component first? 
> Model / Behavior? As does this eat up resources having Cake look in 
> multiple places for this sort() function.
>
>  
>
> That’s what I want to know, with the Component / Model / Behavior having 
> the same name is that bad. Is this sending Cake on a quest thru all of 
> these files until it finds it? 
>
> How does it know to look in the Component first, Model Second, Behavior 
> third? That’s the question I was curious about.
>
>  
>
> Thanks.
>
>  
>
> Dave
>
>  
>
> *From:* [email protected] <javascript:> [mailto:
> [email protected] <javascript:>] *On Behalf Of *euromark
> *Sent:* Tuesday, August 06, 2013 6:19 PM
> *To:* [email protected] <javascript:>
> *Subject:* Re: Naming Question
>
>  
>
> It's not Sortable.sortable, but Sortable.Sortable
>
> same goes for the behavior of such a plugin:
>
>  
>
>     public $actsAs = array('Sortable.Sortable');
>
>
>
> Am Dienstag, 6. August 2013 21:02:53 UTC+2 schrieb advantage+:
>
> Just a quick question,
>
>  
>
> I downloaded a plugin call it "Sortable" since I do not want to knock 
> anyone's work and looking at the plugin I noticed the names of the Model 
> and Component are the same "Sortable".
>
>  
>
> AppController has the component Sortable.sortable in the array.
>
> So in any controller using the plugin it calls for 
> "$this->Sortable->sort($data);" for example.
>
> Respective model has $actsAs = "Sortable";
>
>  
>
> Is this bad? Is Cake going to take a hit looking in the Sortable 
> Model/Behavior and the Sortable Component for the sort function?
>
> Where does it look first for the "$this->Sortable->sort($data);"? In the 
> Sortable Component or Model?
>
>  
>
> Is this how it should be done? Just curious.
>
>  
>
> *Dave Maharaj*
>
> *Freelance Designer | Developer*
> [image: Description: header_logo]
> www.movepixels.com  |  [email protected]  |  709.800.0852
>
>  
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to