Displaying &amp instead of & in View file using CDetailView

Displaying "&amp" instead of "&" in View file using CDetailView. I have a database with a varchar2 field that has an "&" in it, example: "Mom & Pop". It gets displayed as "Mom &amp Pop".

I used gii to create. In the view.php is the following.

[indent]array(‘name’=>‘DEALER_ID’, ‘value’=>CHtml::encode($model->dealer->dealer_name).[/indent]

I’m not sure if this is a database issue or how it is being displayed using CHtml.

Thank you.

Your answer is simple :)


If you follow the link you find there, you’ll read:


I read through the link you gave me and tried using "decode" instead of "encode" and that worked.


Not sure if that is what you meant but it worked.

I also tried


but that didn’t work. Not sure where the “html_specialchars” goes.

I previously had tried " ‘filter’, ‘filter’=>‘html_entity_decode’ " in rules section but that didn’t do anything.

I’m new to using frameworks and object oriented coding. So far I really like this one.

Thank you.