Hi, what should be the controller, if I want to have two different forms on the same page. Actually forms are very similar, only one type of form is used to send emails to page admin, and another to user, who submitted the form (to get PDF catalog).
Like I wrote, one form is contact form to send inquiry, another form is to get PDF catalog. So should be two separate forms with different actions - one to send email to admin, another - to send email to visitor, who filled the form.
So you give your submit buttons different names (form_a, form_b), and then in your controller check with an if statement, which for was submitted.
if($kirby->request()->is('POST')) {
if (get('form_a')) {
// do stuff when form_a was submitted
}
if (get('form_b')) {
// do stuff when form_b was submitted
}
}