如何将此功能放入按钮?单击按钮时需要显示。
public function index()
{
$student_applied_tbl = $this->create_table([
//tbl_id
"tbl_id" => "tbl_student_applied",
//column headers name address type and button headers
"tbl_headers" => ["Student_Name","Service Name","Status",""],
"tbl_rows" => []
], true, base_url("index.php/dashboard/get_applied"));
答案 0 :(得分:0)
“将功能放入按钮”?您的意思是在单击按钮时执行该功能吗?
以下是如何使用 PHP,JavaScript / jQuery,AJAX 实现这一目标:
<form>
或者您可以将 PHP与<form action="your-file.php" method="post">
<input type="submit" name="run-function-button" id="run-function-button" value="Execute Function">
</form>
<?php
if (isset($_POST['name'])) {
index();
}
?>
:
businessId
dksldfaw2
kkldsdok3
djdfkdfk3
23lksdlk8