Using models in index

This might seem like a terribly stupid question, but…

When in views/post/show, how can I use information from other model? Like using a User’s short bio in a post view.

Example of what a post would look like:

Title <- Part of the post model

Content <- Part of the post model

Author <- Part of the post model

Author’s short bio <- Part of the user model

How can I access the user model information in a different (non-user) view?

In show action you are supposed to join author information with the post.


$model = post::model()->with("author")->find($condition);

I advice you read about MVC structure and Active record

Oh, now I see. Thanks… I was thinking about it all wrong