Search code examples
yiiyii1.x

render a view from another controller, yii


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.


Solution

  • try this

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