Let’s say I load a view of an author that displays their information using a CDetailView. How could I load a CGridView below it that displays all of their posts? Can somebody point in the right direction with this? Thanks!
I was thinking that should work. I have relations set and they appear to be working as I can get the related models data from the parent model using a foreach statement. I plopped the CGridView in and never got it to work. I’ll have to review my code again. Thanks for clarifying that it should be working that way.
The problem is with cleaning it up and formatting the table a little more. Right now all of the labels read author_id, post_id, content and created. I’d like to manually set them or have them pulled from the labels set in the actual model to Author ID, Post ID, Content and Created.
Hmm that seems to the the problem then. My labels are set in the posts model (actually they were set with Gii and haven’t been changed since). Of course I’d prefer to have it read the label from the model because that would be easier to update in the future if needed. Not sure why that isn’t working. It read the labels from the model when I do anything else using that model.
Ah, I was getting name and label mixed up. Cheers for the help. At least now I can move forward