I'm experimenting with CakePHP and I'm just surprised by how hard is it to accomplish the very simple task of reading a POST parameter.
The problem is, I don't use a form to submit the data. I'm using CakePHP as an API for my application and the provided values do not follow the naming conventions, so when I do pr($this->request->data)
it just returns empty.
Suppose that I have parameters such as username
and password
sent to my /authenticate/login
action and I need to read them to be able to perform the login. I don't want to require the users to provide parameters with names like data[Users][username]
.
I can't understand why CakePHP developers like to require you to do so to be able to access them in the application! Why making our lives harder and not just provide a simple function like $this->input->post('username')
?