Hey Guys I want to call model from another model. Actually I need data from model2 to model3.
Can you tell me how to call model2 from model3?
Hey Guys I want to call model from another model. Actually I need data from model2 to model3.
Can you tell me how to call model2 from model3?
Just like you would anywhere else:
// Model 3
public function useModel2()
{
$model2Data=Model2::model()->findAll();
$model3Data=Model3::model()->findAll();
// play with data here <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/smile.gif' class='bbc_emoticon' alt=':)' />
}
Thanx