Is it possible to turn of all CakePHP security features for only 1 particular form in a view? So I don't get any hidden fields (tokens) in that form.
Thank you,
Bart
Is it possible to turn of all CakePHP security features for only 1 particular form in a view? So I don't get any hidden fields (tokens) in that form.
Thank you,
Bart
You can disable it for that action via:
public function beforeFilter() {
parent::beforeFilter();
if ($this->request->params['action'] == 'action') {
$this->Security->validatePost = false;
}
}
In order to remove annoying hidden inputs _Token.key
and fields
from your form (for instance, to clarify query string when you use GET
method), you need to do following stuff on beforeRender
in addition to beforeFilter
from tigrang's answer:
function beforeRender() {
parent::beforeRender();
unset($this->params["_Token"]);
}
(This is actual at least for CakePHP 1.3)
© 2022 - 2024 — McMap. All rights reserved.