First of all, thanks for this wonderful framework, it was the first one I could grasp and use it to cover my needs.
I am having trouble creating a complex model. I created a model to receive input from the user and I will have to call a web service and send a response back to the user. All is working well but I have 3 fields that can be repeated 'n' number of times, and I have to convert these fields to a specific string format required by the web service.
I couldn't find any example of a model with array fields and create 3 additional models just to use tabular input seems a little bit too complex (and verbose) for what I need.
How would be the correct way to handle this? I used jquery relCopy plugin to take care of field replication and it does exactly what I need but I am having trouble collecting the user input to make the conversion and calling the web service correctly afterwards.
If you need any additional info, feel free to ask.
While I understand what you are suggesting, simply using regular php I end up losing the "Yii way" of doing things. I need to do this without losing ajax data validation, error handling and all the good things Yii does for you and still deliver the data to the model without too much manual labor.
If I have to this manually, I will stick to the ugly copied and pasted field replication I am using today (which I know sucks and limits the final user a lot.
Maybe I’m getting this from the wrong perspective, but as I stated in the original thread, it seems kinda hard to have to create 3 models in HAS_MANY relationship and use tabular input just to create 3 simple string fields.
There is no database representation of this model, so I shouldn’t have a complex model to solve such a simple problem in an elegant way.
Can’t I just define an array field in the model and in some way tie this to the view in a simpler manner?