To ensure that your controller must implement ViewContextInterface .
use yii\base\ViewContextInterface;
use yii\web\Controller;
class HomeController extends Controller implements ViewContextInterface
Then just add the getViewPath () method , which should return the desired directory path:
public function getViewPath()
{
return Yii::getAlias('@frontend/views/newview');
}
You can use aliases here.
Also check out the official documentation for organizing views.
source
share