kartik-v / yii2-detail-view

Various enhancements to the Yii 2 Detail View with ability to edit data and manage styles using BS3.
http://demos.krajee.com/detail-view
Other
70 stars 56 forks source link

How to show data from other model based on an id as foreign key? #140

Closed kevingatp closed 5 years ago

kevingatp commented 7 years ago

Hi Kartik, Thanks for this awesome ext :)

My application has a db that at least has 2 tables:

  1. class =>

    • id => as PK
    • class_name
    • teacher_id
  2. student =>

    • id
    • class_id => as class_id as foreign key from class table
    • student_name
    • age
    • sex

and in my index.php(class), I've use Kartik Gridview for showing the data of the class. As you know, there are many actions in gridview, such as view button action. Example: My index.php show a data from class with id = 101 in gridView form. How do I can show all student_name from student table that has class_id = 101?

Thanks

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.