Tuesday, August 6, 2013

Naming Question

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

 

No comments: