O'Reilly logo

Web Application Development with Yii 2 and PHP by Jeffrey Winesett, Mark Safronov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The View component

The View component responsible for making the output for the web application clients is one of application components configurable through the application config in the components.view key. To learn the complete list of parameters, you can either look at the documentation about the yii\web\View class or just take a look at its source code, as the documentation is autogenerated from the comments in the source code anyway.

View, being an application component, allows you to execute the following:

Yii::$app->view->render($viewAlias, $params);

The Controller class has a wrapper method that abstracts the View component a bit:

$this->render($viewAlias, $params);

However, the controller doesn't just wrap the call to the View component. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required