1
我在我的項目期運用Symfony和我以前在樹枝這個代碼顯示活動或disactive按鈕在我的會員名單的Symfony,如何設置成員作爲主動或不
{% for item in members %}
<form action="{{dol_url()}}/m71Verein/app.php/member/showList/edit/{{id}}" method="POST">
<tr>
<td>{{item.contact.fullname}}</td>
{% if item.state == 1 %}
<td><button type="submit" value="{{item.id}}" class="btn btn-default btn-xs">Deaktivieren</button></td>
{% else %}
<td><button type="submit" value="{{item.id}}" class="btn btn-default btn-xs">Aktivieren</button></td>
{% endif %}
</tr>
</form>
,但我想現在知道如何在點擊按鈕後將值更改爲0,將值從0更改爲1並將其從1更改爲0
請爲會員/ showList/edit/{id}添加控制器代碼 – JimL
我建議添加一個路由名稱,以便您可以使用樹枝中的路徑功能打印URL,還可以簡化if/else,不得不重複按鈕。 http://pastebin.com/eGq5T4Jy – JimL