Perform table lookup using GridView and TableView

I am using Yii 2.

I have a fairly simple set up tables…

One has several fields to display and one of them is the row ID of a lookup table. Just the ID and NAME.

I am trying to use the ID to retrieve the NAME for display in GridView and TableView.

Right now it is just displaying the ID itself…

I am able to get the data from the lookup table to use in a dropdown box and can change the NAME field this way…

It boils down to… How do I do Table Lookups in GridView and TableView?

Thanks

-John

Hi,

Check this link.

:)

I can see how to do it in my controller, but how do I get that information into GridView and TableView.

The example you provided gives references to several lines of code to retrieve a record, then pull out the field

needed. but can i run several lines of code as a parameter of GridView? Or how do I retrieve this info in my

controller and send it to the view for display by GridView?

Or is is another case of XYZ is the greatest thing ever as long as you want to do exactly what it does… :(

Thanks

-John