extensions, components...

Hi all,

i have an headache about when use an extensions and when use a components, can somebody help me?

a second headache is about, what is the best practice about where to put, behaviour and action independent class.

Thank’s a lot!

if it is reusable code, put it in an extension

That’s the only difference? extensions is reusable components?

And for the actions & behavior class i put them in extentions if it’s reusable too, in a folder :

extentions/actions/___.php

extentions/behaviors/___.php

?

Partially you answered your own question :). I tend to put all behaviours, partial class, widgets etc. into component directory. “Extension” is just a name. It can be anything including a css file and small php class to publish it. So if you downloaded something from yii extensions library or you created something you want to share with community (or maybe reuse in other projects) put it into extension dir.

In fact, the two are the same, the name "extension’ is just here for saying, “hey men you download/share this code” ?

Yes, that’s how I understand it.