yii2 conflict in Urlmanager

55 Views Asked by At

Help me find a solution for subsections.

Category: /blog/cat1/ /blog/cat/cat2/cat3/

Detail: /blog/cat/cat2/cat3/element_code

Subsection for tags in section 'blog': /blog/tag/ /blog/tag/some-tag/

I have this rules:

[
                'pattern' => '/blog/tags/<title>',
                'route' => 'blog/tag',
                'encodeParams' => false
            ],
            [
                'pattern' => 'blog/tags/',
                'route' => 'blog/tags/',
                'encodeParams' => false
            ],

            [
                'pattern' => 'blog/<category:[\w_\/-]+>/<slug>',
                'route' => 'blog/post',
                'encodeParams' => false
            ],
            [
                'pattern' => 'blog/<category:[\w_\/-]+>',
                'route' => 'blog/category',
                'encodeParams' => false
            ],

But in tag section (/blog/tag/) Category controller starts, no Tag controller. What to do in this case?

0

There are 0 best solutions below