I’ve been seeing some things about CHtml::link() and createUrl(), and by what I saw through the API CHtml::link(), creates links using the createUrl() through the normalizeUrl().
So, It is not enough just use CHtml::link() to create links and/or urls? Another question, when we must use the CHtml::link() or the createUrl()? What is the most important argument for choosing one or other?
Another thing that I have seen some people use is:
The method CHtml::link is going to call normalizeUrl only when its second parameter is passed as an array.
CHtml::normalizeUrl converts array format into string format.
The string resulting from CController::createUrl(wrapper around Yii::app()->createUrl) or string containing some external link is not going to invoke CHtml::normalizeUrl.
So if you are passing CController::createUrl as a second parameter to CHtml::link, it means that you yourself normalizing the url.
CController::createUrl/CHtml::normalizeUrl/Yii::app()::createUrl/CUrlManager::createUrl - All these methods we internally use inside the code for which end user has no knowledge about it.
CHtml::link method is helpful in creating visible links on pages.