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: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of euromark
Sent: Tuesday, August 06, 2013 6:19 PM
To: cake-php@googlegroups.com
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
www.movepixels.com | dave@movepixels.com | 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 cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment