user3724249
user3724249

Reputation: 11

Can I have a custom URL format in Yii

Following is the URL:

http://localhost/abc/xyz/ddd.php?json=[{ "rrrr": "ABC", "vvvv": "56464rgdfSAA345", "uuuuu": "12345678"}]

The above URL is in core PHP, I want to give the same format in Yii framework for web service.
How do I give the following part url in Yii:

http://localhost/abc/xyz/ddd.php?json=[{ "rrrr": "ABC", "vvvv": "56464rgdfSAA345", "uuuuu": "12345678"}]

Can anyone out there let me know what I can do to achieve such an URL in Yii?

Upvotes: 1

Views: 74

Answers (1)

Samuel Liew
Samuel Liew

Reputation: 79113

In UrlManager config:

'rules' => array(
    'xyz/ddd.php?json=<json>' => 'xyz/customAction',

In controller XyzController.php:

public action customAction($json) {

    // do something
}

Upvotes: 1

Related Questions