redirect yii2 does not work

0

Good afternoon I hope you can help me, I have a strange problem and it does not work redirect, anywhere in my application. not even when logging in ... when executing the action it does all the procedures of the method but when redirecting it stays in the same url and the page goes blank.

'urlManager' => [ 
    'class' => 'yii\web\UrlManager', 
    'enablePrettyUrl' => true, 
    'showScriptName' => false, 
    'rules'=>[ 
        ' ' => 'site/index', 
        'POST <controller:[\w-]+>s' => '<controller>/create', 
        '<controller:[\w-]+>s' => '<controller>/index', 
        'PUT <controller:[\w-]+>/<id:\d+>' => '<controller>/update',
        'DELETE <controller:[\w-]+>/<id:\d+>' => '<controller>/delete', 
        '<controller:[\w-]+>/<id:\d+>' => '<controller>/view', 
    ],
], 
    
asked by nycarvajal 04.02.2016 в 22:13
source

1 answer

0

To obtain access to controles and actions based on HTTP methods (PUT, POST, DELETE), the rules should be defined as follows:

[
    'PUT,POST <controller>/<id:\d+>' => '<controller>/create',
    'DELETE <controller>/<id:\d+>' => '<controller>/delete',
    '<controller>/<id:\d+>' => '<controller>/view',
]

In this link to Documentation can find more detailed information.

    
answered by 12.02.2016 в 23:54