Monday, February 10, 2014

How does HTTP Post URL for adding multiple records look like?

Dear CakePHP gurus,

I would like to add multiple records to a single model in a single HTTP post. For single record, the HTTP post will look something like "http://127.0.0.1/app/model/api_add/data[Model][Field1]". How will the HTTP Post URL look like for adding multiple records? I will tried different sort of combination but failed.

Below is the add() in the Controller.
        public function add() 
        {             
            if ($this->request->is('post')) 
            {
                $this->Model->create();
                $this->Model->saveAll($this->request->data);
            }
        }

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: