render a view from another controller, yii
Asked 07 September, 2021
Viewed 753 times
  • 51
Votes

The controller:

controllers
|-FooController.php
|-BarController.php

The views:

view
|-foo|
|    |-index.php
|    |-error.php
|
|-bar|
     |-index.php

How to render the error.php view with an action of the bar controller? I have tried:

$this->render('foo/error');

But it doesn't work.

2 Answer