Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 722 Bytes

topic-link-backend-frontend.md

File metadata and controls

25 lines (20 loc) · 722 Bytes

Creating links from backend to frontend

Often it's required to create links from the backend application to the frontend application. Since the frontend application may contain its own URL manager rules you need to duplicate that for the backend application by naming it differently:

return [
    'components' => [
        'urlManager' => [
            // here is your normal backend url manager config
        ],
        'urlManagerFrontend' => [
            // here is your frontend URL manager config
        ],

    ],
];

After it is done, you can get an URL pointing to frontend like the following:

echo Yii::$app->urlManagerFrontend->createUrl(...);