php - Variable not being to view by controller -
controller action
public function actioncreate() { $model=new news; $contentmodel = new newscontent; // if `var_dump( $contentmodel )` here, variable dump correctly $this->render('create',array( 'model'=>$model, 'contentmodel'=>$contentmodel, )); } view
<?php var_dump( $model ); // dumps variable correctly ?> <?php var_dump( $contentmodel ); // dumps null ?> so why contentmodel not being passed view , model is?
note have verified referencing correct view. have tested not passing model variable , seeing null dumped in place of original variable dump in view
both actioncreate , actionupdate render create , update views respectively, both views partially render _form view, displayed.
also, take @ this, helped me lot when getting know yii. understanding view rendering flow
Comments
Post a Comment