Answer the question
In order to leave comments, you need to log in
Why does the method accept post data?
honey code
class Controller_Staff_Ajax extends Controller {
.......
public function action_shop_title()
{
if ( Request::initial()->is_ajax() AND HTTP_Request::POST == $this->request->method() )
{
echo $this->request->method();
var_dump($this->request->post('id'));
var_dump($_POST);
}
}
echo $this->request->method();
Answer the question
In order to leave comments, you need to log in
1. Comment out everything in the method, type var_dump('+++'); and get +++ to appear in the browser and then in the specified program.
2. Then write var_dump($_POST) and send data from advanced rest client POST (for example, via Data form).
3. Make sure that the condition is met (Request::initial()->is_ajax() AND HTTP_Request::POST == $this->request->method()) Most likely it will require changing the Request Header.
4. Return your code)
All right. I did not take into account that the method that receives POST in before() checks for authorization, and then passes the work to the controller method, which in turn works with the variable passing it to the model method. In short, I forgot to update the tab so that the authorization worked.)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question