difference between render&redirect


[color="#FF0000"]What is difference between two below line with example?[/color]

[color="#FF0000"]1)[/color]return $this->redirect(‘www.google.com’);

[color="#FF0000"]2)[/color]return $this->render(‘post’);[/size][/font]

The first redirects to the given url, the second renders a view given as a parameter. Two completely diffrent methods.

What is role of render?

It renders a view - as simple as it could be. Try to read the doc http://www.yiiframework.com/doc-2.0/yii-base-view.html#render()-detail.