Customizing a URL in the advanced template

When working with multiple applications in the same project, you might require access from an application to another, for example, from the backend to a frontend link. This is because we want to display public page rendering in the frontend after inserting data in the backend.

The urlManager property is customized with references about the application where it is defined. However, we can add specific properties to refer to the respective application.

Therefore, in common/config/main.php, we can add these two properties:

 'urlManagerFrontend' => [ 'class' => 'yii\web\urlManager', 'baseUrl' => '/yiiadv/frontend/web', 'enablePrettyUrl' => true, 'showScriptName' => false, ], 'urlManagerBackend' => [ 'class' ...

Get Yii2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.