简体   繁体   中英

In Yii controller

I'm newbie and learning Yii framework where Im designing first small application and got stuck on this position where I need your attention as your guys are guru.

I have a 'City name' list on main layout in header section where a user select a 'City' then I would like to pass that City_id to 'PostController' and search for that city post and display the last Postonly.

Any idea how to handle this.

I look forward to hear from you guys soon and will appreciated an early reply.

Khan

You can use a standard to pass the selected city value to your PostCtonroller, you can then have your PostController call a function within one of your models to run whatever search you need on your database layer. You then take those results, pass them back to the controller and render a new page with your result. You can also do everything with Ajax so its nice and dynamic, but if you're new it would be best to use the basics first.

Also check out the yii framework website as they have a screencast (Video) about using their built in CRUD features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM