I used this function for logout link instead of using it on menu.
this code I used:
<?= Html::a('Logout', ['site/logout'], ['data-method' => 'post']) ?>
Showing-
Method Not Allowed. This url can only handle the following request methods: POST.
How can i solve this issue?