Reputation: 63
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
Upvotes: 6
Views: 2593
Reputation: 4915
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)
Upvotes: 0
Reputation: 6767
You can disable it for that action via:
public function beforeFilter() {
parent::beforeFilter();
if ($this->request->params['action'] == 'action') {
$this->Security->validatePost = false;
}
}
Upvotes: 3