@@ -35,28 +35,7 @@ class SiteController extends Controller
...
@@ -35,28 +35,7 @@ class SiteController extends Controller
```
```
As you can see, typical controller contains actions that are public class methods named as `actionSomething`.
As you can see, typical controller contains actions that are public class methods named as `actionSomething`.
The output of an action is what the method returns, it could be rendered result or it can be instance of ```yii\web\Response```, for example:
The output of an action is what the method returns, it could be rendered result or it can be instance of ```yii\web\Response```, for [example](#custom-response-class).
```php
namespaceapp\controllers;
useyii\web\Controller;
useapp\components\web\MyCustomResponse;#extended from yii\web\Response
classSiteControllerextendsController
{
publicfunctionactionCustom()
{
/*
* do your things here
* since Response in extended from yii\base\Object, you can initialize its values by passing in