Menu from Database

I am a newbie in yii and I am doing this project for my university final semester in subject WEB, I am completed with EER Database and back-end as it was very easy doing back-end in yii. The "gii" helped me auto create every things I wanted to. Now the main problem I am facing is in front-end development.

Please check the attachment for the snapshot of my database.

6460

dbsnap.png

I have two tables in my database one is “page” and next is “category” the data’s in page table have a foreign key of “category_id” assigned to them. I want the menu have the navigation of my category table and when clicked the navigation the page fetch the data from “page” Table according to category.For example : if user press the navigation of “foods” I want he/she get all content of page table that are associated with category “foods”.

My project submission date is very near, i tried everything i knew and every blogs over internet but nothing worked out. Please can anyone here suggest me how can I do it.