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


Updated July 12, 2013 ● 927 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 · 6 years ago
permalink · reply (1)
1

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

Prakash1 · 6 years ago
permalink · reply

Our Terms of Use and Privacy Policy have changed.
By continuing to use this site, you are agreeing to the new Privacy Policy and Terms of Service.