#AskYii: Yii::app()->CreateUrl generates & instead of &. How can I fix this? | #Yii


Updated July 12, 2013 ● 979 views

I was checking my link trough W3C validator and it give me an error saying:

& did not start a character reference. (& probably should have been escaped as &.)

 But this is what Yii::app()->CreateUrl generated. How can I fix this to change & to &amp?

2 Comments

3

You can use CHtml::link(). This generates a hyperlink tag and encodes & to &.

 

DevGuru1 · 10 years ago
permalink · reply (1)
1

@DevGuru1: Thank you... it works now!

Prakash1 · 10 years ago
permalink · reply