Yii - How do I access a view from a module in the applications SiteController?

3k views Asked by At

Just wondering what i need to do to access a modules view in my SiteController class to render that view instead of the index view. i want to access the view which is found in protected/modules/account/views/account/register.php. I know i need to change this line in my SiteController::actionIndex class::method : $this->render('index', array('model' => $model));. but I'm not sure what i need to put to access the module's view. I tried 'account/views/account/register but i get this exception: CException SiteController cannot find the requested view "account\views\account\register"

thanks for any help or direction you can provide

1

There are 1 answers

1
Bharat Parmar On BEST ANSWER

By this you can access modules/mymodule/views/profile/changepassword view

$this->renderPartial('application.modules.mymodule.views.profile.changepassword',array('model'=>$model));