A
A
alex5e2016-01-19 20:14:01
Yii
alex5e, 2016-01-19 20:14:01

How to make UrlManager combine multiple get parameters into one?

The config is configured as follows:

'parts/<group:[\w_\/-]+>/<subgroup:[\w_\/-]+>/<nodes:.+>'=>'node/view',

When you click on a link like
site_point_ru/parts/geely/ck/node-1/node2/110-10-040
In queryParams you get an array of the following content
array (size=3)
  'group' => string 'geely/ck/node-1' (length=15)
  'subgroup' => string 'node2' (length=5)
  'nodes' => string '110-10-040' (length=10)

In this case, several parameters belonging to the node are written to the parameter of group
A, it should be like this:
array (size=3)
  'group' => string 'geely' (length=6)
  'subgroup' => string 'ck' (length=2)
  'nodes' => string 'node-1/node2/110-10-040' (length=24)

Tell me how to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
polar-bear, 2016-01-20
@alex5e

Change URL rule:

'parts/<group:[\w_-]+>/<subgroup:[\w_-]+>/<nodes:.+>'=>'node/view',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question