php - Render view files on Yii framework -
i have 2 models suppose , b contain 2 separate forms. want show content of form b on view page of model a. how render content of b on a. on highly appreciable.
you need pass b model view of model, if you're using code generated yii's crud example in acontroller file can modify this:
public function actionview() { $bmodel = b::model()->findall(); $this->render('view',array( 'model'=>$this->loadmodel(), 'othermodel'=>$bmodel, )); }
after adding 'othermodel' view function, should able access $othermodel in view.php file
Comments
Post a Comment