2017-11-08 9 views
1

yii2 고급 응용 프로그램을 사용하고 있습니다. 프론트 엔드에서 backend \ view \ companies \ index.php를 열고 싶은 탭스 위젯을 사용하고 있습니다.frontend에서 백엔드 cruy를 보는 방법 yii2 고급 폴더

이렇게 할 수 있습니까? 여기

코드 프론트 엔드는 \ 전망은 \ 접촉 \ 어떻게 얻을

echo TabsX::widget([ 
    'position' => TabsX::POS_ABOVE, 
    'align' => TabsX::ALIGN_LEFT, 
    'items' => [ 
     [ 
      'label' => 'gridview', 
      'content' => $content_grid,//**want backend\view\companies\index.php page to open here... how to do it.. ** 
      'active' => true 
     ], 
     [ 
      'label' => 'Basic Search', 
      'content' => $content_basic_search, 
      'headerOptions' => ['style'=>'font-weight:bold'], 
      'options' => ['id' => 'myveryownID'], 
     ], 
     [ 
      'label' => 'Dropdown', 
      'items' => [ 
       [ 
        'label' => 'DropdownA', 
        'content' => 'DropdownA, Anim pariatur cliche...', 
       ], 
       [ 
        'label' => 'DropdownB', 
        'content' => 'DropdownB, Anim pariatur cliche...', 
       ], 
      ], 
     ], 
    ], 
]); 

을을 index.php입니까?

답변

0

linkOptions를 사용해 보셨습니까?

'linkOptions'=>['data-url'=>\yii\helpers\Url::to(['backend/view/companies/index'])] 
+0

시도했지만 작동하지 않습니다. 다른 방법이 있습니까? – Goli

0

내가 전에이 위젯을 사용하지 않는,하지만 난 생각이 도움이 될 것입니다

  1. 를 설정에서 (일반/설정/main.php을)를 BackendUrlManager을 추가

    'components' => [ 
        'urlManagerBackend' => [ 
         'baseUrl' => 'http://backend.myproject.com', //Here you need to insert your backend app link 
         'class'=>'yii\web\UrlManager', 
         'enablePrettyUrl' => true, 
         'showScriptName' => false, 
        ], 
    ... 
    ] 
    
  2. 사용 링크

    'linkOptions'=>['data-url'=>Yii::$app->urlManagerBackend->createAbsoluteUrl(['backend/view/companies/index'])])] 
    
+0

알 수 없음 속성을 설정하려고합니다. urlManagerBackend – Goli

+0

config의 구성 요소 부분에 있어야하며 – MasteRus

+0

은 $ 호스트에 있어야합니다. ?? ... 알림 : 정의되지 않은 변수 : C : \ xampp \ htdocs \ yii2-my-app \ common \ config \ main.php 18 번 줄에 – Goli