I had this question since the time I learned CHtml::link() and other similar functions in CHtml helper class. Is there a specific reason to use these functions? Is it because of some kind of security reason? Is it not better to use <a></a> tag and get the job done instead of using CHtml::link(), since it is easier? Same is the case with CHtml::encode() and other functions. Why can’t we simply place the required content in the view file instead of doing CHtml::encode() on the same?
I feel there is huge concept behind this and would certainly like to learn about it.
Exactly. Once you defined controller/action in the link, you won’t need to change it again when you want the url to look differently. Actually it is most useful when testing applications, because in production links change rarely (for SEO reasons).