Perhaps I am complicating this too much or missing something very simple, so forgive me if I am.
I am trying to manipulate / display some data in my model.
A very simple example of what I'm trying to do:
I have $model->attrthis, it will return everything that is in my database for this column.
I know there will be a refund 1, 2or 3.
When displayed in the presentation, I would like to see this value indicates something else, for the sake of this example, you can say 1=>'red', 2=>'blue', 3=>'green'.
How will I do this in the model? I looked at Accessors and Mutators, but I'm not sure if they are the right thing.
Thanks in advance.
source
share