【发布时间】:2015-04-28 07:10:04
【问题描述】:
我有一个 html 按钮,我想通过控制器操作生成报告,例如,
在我的 PaymentController.php 中
public function actionGenerateRI($date){...}
在我的 admin.php 中
<button type="button" onclick="generateRI()">Generate</button>
<script>
function generateRI(){
var date = document.getElementById("month").value +"-"+ document.getElementById("year").value;
//what should I write here to call the actionGenerateRI?
}
</script>
如何使用我的按钮调用控制器函数并传递变量date?
P/S:它们都在同一个模型中,在这种情况下,Payment。
【问题讨论】:
标签: javascript php yii