E
E
EVOSandru62016-03-01 08:25:49
Yii
EVOSandru6, 2016-03-01 08:25:49

Why in yii1 get parameters are perceived differently in the client side and in the admin panel?

Good afternoon,
Tell me, why if I am in the client side - then when displaying GET parameters, they are displayed as an array:
hotel / 2

Array
(
    [2] => 
    [tenant] => 2
)

If I am in the admin panel, then they are displayed together as a line:
hotel/2/sadmin/bids/update/45
Array
(
    [2/sadmin/bids/update/45] => 
)

(As a string)
Also in this case the Use Yii::app()defines wrong values ​​for:
Controller : site
Action : error
Module : ''
UrlManager :
'class'             =>  'DTenantUrlManager',
    'urlFormat'         =>  'path', // path,get
    'showScriptName'    =>  false,  // index.php
    'rules'             =>
    [
        '<tenant:\d+>/'                                                         =>   'hotels/index',
        '<tenant:\d+>/<action:(login|logout|registration)>'                     =>   'users/<action>',
        '<tenant:\d+>/<action:(contact)>'                                       =>   'site/<action>',
        '<tenant:\d+>/<controller:\w+>/<id:\d+>'                                =>   '<controller>/view',
        '<tenant:\d+>/<controller:\w+>/<action:\w+>/<id:\d+>'                   =>   '<controller>/<action>',
        '<tenant:\d+>/<controller:\w+>/<action:\w+>'                            =>   '<controller>/<action>',
        '<tenant:\d+>/<module:\w+>'                                             =>   '<module>/default/index',
        '<tenant:\d+>/<module:\w+>/<controller:\w>'                             =>   '<module>/<controller>/index',
        '<tenant:\d+>/<module:\w+>/<controller:\w>/<id:\d+>'                    =>   '<module>/<controller>/view',
        '<tenant:\d+>/<module:\w+>/<controller:\w>/<action:\w+>/<id:\d+>'       =>   '<module>/<controller>/<action>/<id>',
        '<tenant:\d+>/<module:\w+>/<controller:\w>/<action:\w+>'                =>   '<module>/<controller>/<action>',
    ],
];

getRequestUri()Class method CHttpRequestDid not override.
But at the same time, for some reason, the following URL is read :
hotel/2/sadmin/bids
Controller: bids
Action: index
Module: sadmin
What could be the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-03-01
@EVOSandru6

there is an error in the last four rules, the controller should have w+,
which is why they are ignored when parsing the url

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question