2
나는 advanced-yii2에서 멀티 테마를하려고합니다. 나는 이것을 위해 많은 방법을 시도했지만 그것이 작동하지 않는다. 나는 이해할 수 없다. 먼저 "frontend/config/main.php"에 추가했습니다.Yii2에서 기본보기 경로를 변경하는 방법은 무엇입니까?
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => [
'@webroot/themes/demo/views',
]
],
],
],
내가 예를 들어, 프론트 엔드의 새로운 뷰 클래스를 만드는 시도 후이 작동하지 않았다
namespace frontend\components;
class NewsView extends \yii\web\View {
function init() {
\Yii::$app->view->viewPath = '@webroot/themes';
parent::init();
}
}
및
'view' => [
'class' => 'frontend\components\NewsView',
config.php를 추가하지만 그것을 너무 효과가 없습니다.
어떻게해야합니까?
나는 이것을 잘못 생각했다. SiteController는 "index.tpl"로 렌더링하려고하는데, "index.tpl"이 없다. :) – Serhat