renderrender is used to display page with layout or theme.
renderPartialThe renderPartial() method is also used for Ajax calls, where the layout isn't appropriate
It will show content of particular view file only and will not include theme files like css, js, header, footer etc.[empty theme content view]
- When we make a ajax request where we have to show only page body, We will use the renderPartial
- To access the different controller view file, we will use the renderPartial.
<?php $this->renderPartial('//controller/view')?>"//"- will render the view protected/views/controller/view.php
<?php $this->renderPartial('/controller/view')?>"/"- will render the view from current module
Another Controller ViewUsing renderPartial() method we can call the view of another controller. We can reuse view files. we can call function in view and controller files.
<?php $this->renderPartial( 'application.views.user.index', array( 'data'=>'Welcome', 'model'=>$model, ));?>