Create Global Function for Model

i recently create a function which only use for model.

and my question is my function should put it in where so i can access from other model…

thanks…

Not completely sure about the meaning of your question. If you have a method you would like to use in many Models then I would create a parent Model class. Then each Model where you want that functionality, extend that parent to create new Models.

Hope that helps.

thanks for reply…

i think i must stick to your solution and i have to change my model class one by one to the new one…

thanks again…

Or you can make a static method… and call it from anywhere you need (like CHtml in Yii)… it all depends of your needs and what that method does…