D
D
Dauren S2017-02-21 12:55:46
Yii
Dauren S, 2017-02-21 12:55:46

Yii2 ur rules inside a module?

I want to register url routes in the module, not in config/web. How can I do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-02-21
@webinar

'components' => [
....
        'urlManagerFront' => [
            'class' => 'yii\web\urlManager',
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => require(__DIR__ . '/../modules/myModul/someDir/routes.php'),
        ],

well, or depending on why you need this stupid idea, there are a lot of methods for UrlManager, for example: I
advise you to first read about the yii2 application life cycle here:
https://nix-tips.ru/yii2-api-guides/guide-ru -struc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question