UrlManager - verb PUT #2293

Closed
stepanic opened this Issue Apr 4, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@stepanic

stepanic commented Apr 4, 2013

In UrlManager when I put statement:
'api/id:(drive|)/var:d+'=>array('rest/drive/restUpdate', 'verb'=>'PUT'),
Works perfect to access to /api/drive/77

Without Pipe, give me: "Unable to resolve the request "api/drive""
'api/id:(drive)/var:d+'=>array('rest/drive/restUpdate', 'verb'=>'PUT'),

For GET verb everything works perfect, same statement, but different action:
'api/id:(drive)/var:d+'=>array('rest/drive/restView', 'verb'=>'GET'),

@resurtm

This comment has been minimized.

Show comment Hide comment
@resurtm

resurtm Apr 4, 2013

Contributor

Unable to reproduce. What i've done:

  • Created fresh application. (I used upstream/master code.)
  • Configured URL manager as follows:
'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName'=>true,
    'rules'=>array(
        'test/act1/<p1:(str1)>/<p2:\d+>'=>array(
            'test/action1',
            'verb'=>'GET',
        ),
        'test/act2/<p1:(str1)>/<p2:\d+>'=>array(
            'test/action2',
            'verb'=>'PUT',
        ),
    ),
),
  • Controller:
<?php

class TestController extends Controller
{
    public function actionAction1($p1,$p2)
    {
        echo 'action1_'.$p1.$p2;
    }

    public function actionAction2($p1,$p2)
    {
        echo 'action2_'.$p1.$p2;
    }
}
  • And finally request:
$ curl -XPUT http://hostname/index.php/test/act2/str1/123
action2_str1123
$ curl -XGET http://hostname/index.php/test/act1/str1/123
action1_str1123

Could you please provide information on how can i reproduce your issue on top of the fresh application?

Contributor

resurtm commented Apr 4, 2013

Unable to reproduce. What i've done:

  • Created fresh application. (I used upstream/master code.)
  • Configured URL manager as follows:
'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName'=>true,
    'rules'=>array(
        'test/act1/<p1:(str1)>/<p2:\d+>'=>array(
            'test/action1',
            'verb'=>'GET',
        ),
        'test/act2/<p1:(str1)>/<p2:\d+>'=>array(
            'test/action2',
            'verb'=>'PUT',
        ),
    ),
),
  • Controller:
<?php

class TestController extends Controller
{
    public function actionAction1($p1,$p2)
    {
        echo 'action1_'.$p1.$p2;
    }

    public function actionAction2($p1,$p2)
    {
        echo 'action2_'.$p1.$p2;
    }
}
  • And finally request:
$ curl -XPUT http://hostname/index.php/test/act2/str1/123
action2_str1123
$ curl -XGET http://hostname/index.php/test/act1/str1/123
action1_str1123

Could you please provide information on how can i reproduce your issue on top of the fresh application?

@ghost ghost assigned resurtm Apr 4, 2013

@resurtm

This comment has been minimized.

Show comment Hide comment
@resurtm

resurtm Apr 9, 2013

Contributor

Closing this. @stepanic i'll reopen it if you will provide mature way of reproducing this issue. I think this is your fault. Correct me if I'm wrong.

Contributor

resurtm commented Apr 9, 2013

Closing this. @stepanic i'll reopen it if you will provide mature way of reproducing this issue. I think this is your fault. Correct me if I'm wrong.

@resurtm resurtm closed this Apr 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment