Cdetailview With Many Data Per Field

Hi. I was wondering if there is any way I could do to make the data of the CDetailView ‘entered’ whenever there are many values. These values are separated by commas.

The form is a textArea not a textField that is why I could ‘enter’ my input.

Sample Input:

Chicken,

Beans,

Corn

Supposedly Output:

Chicken,

Beans,

Corn

but it comes out like this:

Actual Output:

Chicken, Beans, Corn

Attached are images of my question.

4857

question.png

Hoping someone could help me. Thank you so much in advance!

Hi,

you have to change format after fetching the data from database.

afterfind() or beforesave()

This is one way…

but if u want permanent solution …use some htmleditor

How do you store values for those attributes?

The default type of an attribute in a CGridView or CDetailView is 'text, but there’s also ‘ntext’ which converts newlines to ‘<br/>’.