Reputation: 3
I have created 'contact_us' CRUD in frontend. Now I want to show listing of that contact_us (i.e. index.php) in backend. how can I access it?
Upvotes: 0
Views: 383
Reputation: 133400
You should add a new urlMangerBackend in urlManager component in your frontend application /config/main.php and then refer to this in your createUrl
return [
....
'components' => [
'urlManager' => [
// your normal frontend URL rules
],
'urlManagerBackend' => [
'class' => 'yii\web\urlManager',
'baseUrl' => '/yourapp/backend/web',
'enablePrettyUrl' => true,
'showScriptName' => true,
],
],
];
and you can invoke this way
Yii::$app->urlManagerBackend->createUrl();
Upvotes: 3