0

Let's assume that the Security Component in cakephp is enabled.

When creating a form, for example for user registration (/users/add), is it needed to use the $fieldList when saving the data in the controller:

$this->User->save($this->request->data, true, $fieldList);

Or the allowed fields are already defined and guarded by the Security Component?

Thank you!

4

1 回答 1

0

If the fields are named correctly, you can just use this:

$this->User->save($this->request->data);

If you want to validate the data from the form, you can additionally use the validation that can be implemented through the Model.

于 2012-08-22T12:56:20.840 回答