Skip to main content
Topic: Conventions (Read 6170 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Conventions

Well, the subject is a bit general, though I have almost only one example in mind at the time, so I'll obviously ask about that, if you have more/others feel free to add.

createList and the callbacks to count/list things.
At the moment we do that in two (main, because I think there are more) different ways:
1) have a list_something and list_[num|count]something in the controller that are in fact wrapper for a function in a subs files,
2) directly call the function in the subs file (including the file using createList or just before that).

So, what's our "favourite" approach?
Bugs creator.
Features destroyer.
Template killer.

Re: Conventions

Reply #1

From what I've been told

Code: [Select]
            'get_items' => array(
                'function' => array($this, 'list_loadSomeCount'),
then

Code: [Select]
	public function list_loadSomeCount($all, $type)
{
   return countSomeCount($all, $type);
}


Is the preferred way, yeah that first call can simply be the old 'function' => countSomeCount() as well but its less flexible.

Re: Conventions

Reply #2

Good! :D

 emanuele wonders how many should be rewritten then. O:-)
Bugs creator.
Features destroyer.
Template killer.