Sreeraj
Sreeraj

Reputation: 2720

How do i get Module, Controller, action and request params of a Yii based url without using Yii

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

Upvotes: 1

Views: 955

Answers (1)

user133408
user133408

Reputation:

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.

Upvotes: 1

Related Questions