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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -