In which case I have to use extensions, helpers, widgets or components?
I have read the guide but do not fully understand the differences between them and when to use one or the other.
Thanks!
In which case I have to use extensions, helpers, widgets or components?
I have read the guide but do not fully understand the differences between them and when to use one or the other.
Thanks!
Extension: I create an extension when I implement a feature that is not on the library and ‘extends’ its functionality from an already built component or a new one. An extension can be anything… (helper, widget, behavior, child object… whatever).
Widget: I create widgets when is mostly related to HTML elements to be rendered. I take advantage of its live process: init() , run(), beginContent(), endContent(), etc… In order to render the elements. Those elements can be anything from Clips, Portlets, to Lists and even Grids.
Helper: If you look on CHtml object you will clearly understand what is a helper
IMHO, in fact, extensions, widgets, helpers they are just terms, as all of them are components with different live cycle http://www.yiiframework.com/doc/api/1.1/CComponent
Thanks for the explanation Antonio, very useful to me.
(pd: do you speak spanish?)
SI hablo español? Por supuesto…