The following is a small snippet of my routes in _urlManager.php
["pattern" => 'POST /create_chain', 'route' => 'site/add-chain'],
["pattern" => '/create_chain', 'route' => 'site/create-chain']
As you can see for POST I want a different action to be called. But this does not work.
For now I've used the following solution on temporary basis:
"POST /create_chain" => "site/add-chain",
["pattern" => '/create_chain', 'route' => 'site/create-chain']
But I'm not OK with this solution. If anyone knows how I can integrate HTTP VERB in pattern
, please comment or answer.
答案 0 :(得分:0)
如果要使用数组语法配置动词,则应使用verb
键:
["pattern" => '/create_chain', 'verb' => 'POST', 'route' => 'site/add-chain'],