渲染渲染部分路径主题yii2


rendering render partial path theme yii2

我的yii(2)应用程序的结构如下:

<>之前___Backend___frontend______| |__控制器SiteController.php| | |__…(其他控制器在这里…)| |__模型| |__视图||| __||:||__主题(我的主题)| __CompanyProfile| __Index.php| __CSS| __fonts| _…之前

i在yii 1中使用以下代码呈现:(yii 1)

public function actionPages($id){
    Yii::app()->theme = 'CompanyProfile';
    $this->renderPartial('CompanyProfile/views/layouts/Index',array(
        'model'=>PrCompany::model()->findByPk($id),
    ));
}`

但是我无法在yii2中渲染局部。如何在yii中渲染偏置

try

public function actionPages($id){
    $this->renderPartial('@frontend/themes/CompanyProfile/views/layouts/Index',array(
        'model'=>PrCompany::model()->findByPk($id),
    ));
}`