Scenario
I have one YII project and its working fine with URL Manager (SEO friendly URL), so that the URL will be like the following
http://example.com/Controllername/action/paramName/ParamValue
I implemented another php application which is in row php(with out Yii), I will get this URL as input param in the row php application, but i need to explode it as separate module, controller,actions and params.
I want to use the Yii's same algorithm to decode the module, controller, action , param name s and values.
How do I get the Module name, Controller name, Action name and param names by providing the Yii's URL in a row php code?
Note : I dont have an special condtions in Url Manager
Well, your ulrManager might have some url rules. Without knowing rules, it is impossible to reliably decode params (and controller, module, action) properly. I suggest include yii config with rules, and use yii url managers parseUrl()
to get params.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.