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


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

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

Prakash1 · 11 years ago
permalink · reply

This website uses cookies. By continuing to use this site, you are accepting our Privacy Policy and Terms of Service.