Answer the question
In order to leave comments, you need to log in
How to do csrf phalcon validation?
How to do token validation in Phalcon 3.2 form
In documentation like this
if ($this->request->isPost()) {
if ($this->security->checkToken()) {
// The token is OK
}
}
$csrf = new Hidden('csrf',
[
'name' => $this->security->getToken(),
'value' => $this->security->getToken(),
]
);
$csrf->addValidator(new Identical([
// $this->security->checkToken()
]));
$csrf->clear();
$this->add($csrf);
$this->add(new Submit('go', [
'class' => 'btn btn-success'
]));
{{ form('class': 'form-search') }}
<p>
{{ form.render('csrf') }}
</p>
<p>
{{ form.render('go') }}
</p>
</form>
{{dump(this.request.getPost())}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question