You can extend the CHtml
class and add your own functions. The code should look something like this:
class MyHtml extends CHtml {
// add you own logic or override CHtml functions
public static function myFunction() {
return 'yeah!';
}
}
You can then use MyHtml::myFunction()
and also use all the standard CHtml functions.
Take a look at this question for more info on extending classes in Yii: How to extend Yii framework classes and where to place the files