Reputation: 436
I am using yii2 advanced app. and in frontend I am using tabsx widget from which I want to open backend\view\companies\index.php.
Is it possible to do so and how?
here is code 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...',
],
],
],
],
]);
how to get that?
Upvotes: 1
Views: 302
Reputation: 111
I don't use this widget before, but I think, it will help:
Add a BackendUrlManager in config (common/config/main.php):
'components' => [
'urlManagerBackend' => [
'baseUrl' => 'http://backend.myproject.com', //Here you need to insert your backend app link
'class'=>'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
],
...
]
Use a link
'linkOptions'=>['data-url'=>Yii::$app->urlManagerBackend->createAbsoluteUrl(['backend/view/companies/index'])])]
Upvotes: 0
Reputation: 745
Have you tried using linkOptions?
'linkOptions'=>['data-url'=>\yii\helpers\Url::to(['backend/view/companies/index'])]
Upvotes: 0