I'm building a Free Market question and answer management project.
I made the project in php based on the MVC architecture. I created a class called "QuestionsController", in which it has 2 methods. A GET method that looks up the questions in the free and saved market API in the bank and another POST method that answers the questions.
My difficulty is that I'm using friendly urls and I do not know how to pass POST as a parameter.
This is my index that is in the public folder, where they initially hit all my requests.
try {
$controller = new Controller;
$controller = $controller->load(); //faz leitura da URI e instancia a controller
$method = new Method;
$method = $method->load($controller);
$parameter = new Parameter;
$parameter = $parameter->load();
$controller->$method($parameter);
} catch (Exception $e) {
dd($e->getMessage());
}
My form looks like this:
<form action="../perguntas/responder" method="post" name='responder' value= 'resposta'>
Following the mvc / restful architecture, should my form's action be the index or should it be the way it is and figure out how to send $ _POST through friendly url? If it's the second option, does anyone have any indication material on how to send friendly url post parameters?