In Rails we can do
= link_to 'Logout', destroy_user_session_path, method: :post
How do we achieve this in Yii? (Without having to manually create a hidden form: Make a link use POST instead of GET.)
I looked through the guide for Url
for post
, but couldn't find anything.
http://www.yiiframework.com/doc-2.0/guide-helper-url.html
So far I have this
%a.btn.btn-sm.btn-success{href: Url::to(['update-bid', 'change' => 'plus'])} +10%
Try this:
<?= Html::a('submit', Url::to(['site/index']), ['data-method' => 'POST']) ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With