Перейду сразу к сути. Есть метод класса
class HomeController {
public function update($id)
{
$update->table('tasks') // update this table
->cols([ // update these columns and bind these values
'id' => 'id',
'title' => 'title',
'content' => 'content',
]);
$sth = $this->pdo->prepare($update->getStatement());
$sth->execute($update->getBindValues());
$myTask = $sth->fetch(PDO::FETCH_ASSOC);
header("Location: /tasks"); exit;
}
}
Хочу повесить выполнение этого метода сюда в экшн
<form action= "" method="post">
Подскажите, как это сделать?