我正在使用yii2高级应用程序。在前台,我使用的是tabsx,我想用它打开backend\view\companies\index.php。
这样做有可能吗?如何做到?
下面是代码frontend\views\contacts\index.php
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...',
],
],
],
],
]);如何做到这一点?
发布于 2017-11-08 16:23:42
你试过使用linkOptions吗?
'linkOptions'=>['data-url'=>\yii\helpers\Url::to(['backend/view/companies/index'])]发布于 2017-11-08 19:47:14
我以前没有使用过这个小部件,但我认为它会有所帮助:
‘'components’=> [ 'urlManagerBackend‘=> 'baseUrl’=> 'http://backend.myproject.com',//此处您需要插入后端应用程序链接‘class’=>‘yii\baseUrl\UrlManager’,'enablePrettyUrl‘=> true,'showScriptName’=> false,,... ]
'linkOptions'=>['data-url'=>Yii::$app->urlManagerBackend->createAbsoluteUrl('backend/view/companies/index')])]
https://stackoverflow.com/questions/47174622
复制相似问题