【发布时间】:2015-09-21 18:56:15
【问题描述】:
在 Rails 中我们可以做到
= link_to 'Logout', destroy_user_session_path, method: :post
我们如何在 Yii 中实现这一点? (无需手动创建隐藏表单:Make a link use POST instead of GET。)
我浏览了Url 和post 的指南,但找不到任何东西。
http://www.yiiframework.com/doc-2.0/guide-helper-url.html
到目前为止我有这个
%a.btn.btn-sm.btn-success{href: Url::to(['update-bid', 'change' => 'plus'])} +10%
【问题讨论】:
-
@anantkumarsingh 那是给 Yii1 的。 Yii2呢? Yii2 没有
Chtml。